[Aptitude-devel] sigh, bad old upgrade behavior?

Daniel Burrows dburrows at debian.org
Wed Feb 24 15:44:42 UTC 2010


On Wed, Feb 24, 2010 at 07:23:14AM -0800, Daniel Burrows <dburrows at debian.org> was heard to say:
>   aptitude itself will probably never distinguish between important
> and do-not-care packages (at least not in the sense of optimizing to
> avoid one or the other situation).  However, its resolver hints could
> be used to tweak the score and/or tier of one or more packages to avoid
> this.  Particularly once I finish the current round of changes, it'll
> be entirely conceivable that someone (such as the release team) could
> publish an apt.conf.d snippet containing hints to guide a particular
> upgrade.

  To follow up to myself, there's no reason that some basic hints
couldn't be shipped in the aptitude package.  I was thinking something
like:

Aptitude {
  Resolver::Hints {
    Mode "lenny-squeeze" {
        // Try not to remove package1 (if it's installed).
        "package1 UNINST  increase-cost-level squeeze-upgrade 1";
        // Before the resolver runs, install package3 squeeze-version
        // if package2 lenny-version is already present.
        "package2 lenny-version   prepare-by-installing package3 squeeze-version";
    }
  }

  Resolver::Level-Order {
    Mode "lenny-squeeze" {
      // Try hardest to obey package pin priorities; then avoid
      // deviating from the upgrade plan; then try to avoid canceling
      // upgrades and removing packages.
      "pin-priority, squeeze-upgrade, canceled-upgrades + removals";
    }
  }
}

  (I have no attachment to this syntax, it just came off the top of my
head)

  Then you'd run aptitude with --resolver-mode=lenny-squeeze to activate
those options.

  The level-order specifies a descending sequence of tie-breaks.  It'll
take some tweaking to figure out a "good" order -- I suspect that
removals should be a separate level from canceled-upgrades, but I wanted
to demonstrate that you can add two counters together. :-)

  Daniel



More information about the Aptitude-devel mailing list