Mailinglist Archive: zypp-devel (115 mails)

< Previous Next >
Re: [zypp-devel] Re: [zypp-commit] r6216 - in /trunk/zypper: package/zypper.changes src/zypper-misc.cc src/zypper.cc
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Thu, 26 Jul 2007 10:45:39 +0200
  • Message-id: <20070726084539.GA14179@xxxxxxxxxxxxx>
* Duncan Mac-Vicar P. <dmacvicar@xxxxxxx> [Jul 25. 2007 18:43]:
> 
> I don't understand much the best-effort thing. Can you ellaborate?

Sure.

The current approach to "zypper up" is the following

  foreach (installed-resolvable) do
    candidates = uninstalled-resolvables-with-same-name-as-installed-resolvable
    best = nil
    foreach (candidates) do
      if (best == nil)
        best = candidate
      else if (best.version < candidate.version)
        best = candidate
    end
    mark-for-installation( best )
  end

It looks for update candidates for installed resolvables and picks
the 'best' (highest version) for installation.

With only the official update repo enabled, this algorithm of
blindly upgrading to latest-and-greates works nicely.

However, it calls for trouble when multiple repos provide updates.
The probability of conflicting upgrades is much higher here, esp.
when kernel/driver upgrades come into play.

Best effort tries to give the dependency solver more freedom
when choosing upgrades. The algorithm is like:

  foreach (installed-resolvable) do
    candidates = uninstalled-resolvables-with-same-name-as-installed-resolvable
    foreach (candidates) do
      if (installed.version < candidate.version)
        solver.require (installed-name > installed-version)
      end
    end
  end

This checks if an upgrade candidate exists at all and just tells the
solver to raise the respective installed resolvable to a higher version.
Here the dependency solver is free to choose a lower than latest-and-greatest
version, thereby enlarging the solution domain.

This approach is still flawed since it does not allow to keep the
version of an installed resolvable despite the existance of upgrade
candidates. But as I said, the primary purpose is to gain experience.


The more important extension to zypper is probably '--from-repo' which
limits upgrade candidates to a specific repository. This is a first
step to give repository 'weights' and do selective upgrades.
One might e.g. want to follow a specific buildservice project (KDE4
comes into mind) or focus on the official update repo.

Hth,

Klaus
-- 
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
References