From c427b1e218e61bd1aacbddf9013e58b8aa445a7c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 29 Nov 2010 21:43:07 +0100 Subject: * apt-pkg/algorithms.cc: - mark all installed packages first without auto installation in a dist-upgrade to prefer upgrading packages instead of installing new packages in versioned or-groups (Closes: #605394) --- apt-pkg/algorithms.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 9abb7a947..0fbce3c2a 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -374,6 +374,13 @@ bool pkgDistUpgrade(pkgDepCache &Cache) { pkgDepCache::ActionGroup group(Cache); + /* Upgrade all installed packages first without autoinst to help the resolver + in versioned or-groups to upgrade the old solver instead of installing + a new one (if the old solver is not the first one [anymore]) */ + for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I) + if (I->CurrentVer != 0) + Cache.MarkInstall(I, false, 0, false); + /* Auto upgrade all installed packages, this provides the basis for the installation */ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) -- cgit v1.2.3