The modification to orderlist.cc is from a patch DonKult (David) gave me, The modific...
[apt.git] / apt-pkg / packagemanager.cc
index f49df8327fffd49901e14f6a9dd40b0d0d2bae5a..2219f876a857b78d7906c3d1874749335f8b4d18 100644 (file)
@@ -575,6 +575,9 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
 }
 bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
 {
+   if (Debug == true)
+      clog << "SmartUnPack " << Pkg.Name() << endl;
+
    // Check if it is already unpacked
    if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
        Cache[Pkg].Keep() == true)
@@ -674,6 +677,20 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
            }
         }
       }
+      
+      // Check for breaks
+      if (End->Type == pkgCache::Dep::DpkgBreaks) {
+         SPtrArray<Version *> VList = End.AllTargets();
+        for (Version **I = VList; *I != 0; I++)
+        {
+           VerIterator Ver(Cache,*I);
+           PkgIterator Pkg = Ver.ParentPkg();
+           // Found a break, so unpack the package
+           if (List->IsNow(Pkg)) {
+             SmartUnPack(Pkg, false);
+           }
+        }
+      }
    }
 
    // Check for reverse conflicts.