Prechádzať zdrojové kódy

The modification to orderlist.cc is from a patch DonKult (David) gave me, The modifications to the packagemanager should fix the test-provides-gone-with-upgrade testcase.

Christopher Baines 15 rokov pred
rodič
commit
cfcdf7fe9f
2 zmenil súbory, kde vykonal 23 pridanie a 0 odobranie
  1. 6 0
      apt-pkg/orderlist.cc
  2. 17 0
      apt-pkg/packagemanager.cc

+ 6 - 0
apt-pkg/orderlist.cc

@@ -1073,6 +1073,12 @@ bool pkgOrderList::CheckDep(DepIterator D)
          just needs one */
       if (D.IsNegative() == false)
       {
+      	 // ignore provides by older versions of this package
+	 if (((D.Reverse() == false && Pkg == D.ParentPkg()) ||
+	      (D.Reverse() == true && Pkg == D.TargetPkg())) &&
+	     Cache[Pkg].InstallVer != *I)
+	    continue;
+      
 	 /* Try to find something that does not have the after flag set
 	    if at all possible */
 	 if (IsFlag(Pkg,After) == true)

+ 17 - 0
apt-pkg/packagemanager.cc

@@ -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.