- Make the breaks handling use the kill list. This means, that a
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 6 Feb 2008 13:04:38 +0000 (14:04 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 6 Feb 2008 13:04:38 +0000 (14:04 +0100)
    Breaks: Pkg (<< version) may put Pkg onto the remove list.

apt-pkg/algorithms.cc
debian/changelog

index 503a928..eaab4c0 100644 (file)
@@ -985,17 +985,17 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 
                  if (Start->Type == pkgCache::Dep::DpkgBreaks)
                  {
-                    /* Would it help if we upgraded? */
-                    if (Cache[End] & pkgDepCache::DepGCVer) {
+                    // first, try upgradring the package, if that
+                    // does not help, the breaks goes onto the
+                    // kill list
+                    // FIXME: use DoUpgrade(Pkg) instead?
+                    if (Cache[End] & pkgDepCache::DepGCVer) 
+                    {
                        if (Debug)
                           clog << "  Upgrading " << Pkg.Name() << " due to Breaks field in " << I.Name() << endl;
                        Cache.MarkInstall(Pkg, false, 0, false);
                        continue;
                     }
-                    if (Debug)
-                       clog << "  Will not break " << Pkg.Name() << " as stated in Breaks field in " << I.Name() <<endl;
-                    Cache.MarkKeep(I, false, false);
-                    continue;
                  }
 
                  // Skip adding to the kill list if it is protected
@@ -1066,6 +1066,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
               if ((Cache[J->Dep] & pkgDepCache::DepGNow) == 0)
               {
                  if (J->Dep->Type == pkgCache::Dep::Conflicts || 
+                     J->Dep->Type == pkgCache::Dep::DpkgBreaks ||
                      J->Dep->Type == pkgCache::Dep::Obsoletes)
                  {
                     if (Debug == true)
index 953c122..2a4112e 100644 (file)
@@ -18,6 +18,8 @@ apt (0.7.11) UNRELEASED; urgency=low
       on amd64 in sbuild
   * apt-pkg/algorithms.cc: 
     - add APT::Update::Post-Invoke-Success script slot
+    - Make the breaks handling use the kill list. This means, that a
+      Breaks: Pkg (<< version) may put Pkg onto the remove list.
   * apt-pkg/deb/debmetaindex.cc:
     - add missing "Release" file uri when apt-get update --print-uris
       is run