]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
Changed check in the SmartUnpack method, reverted change in the DepAdd method.
[apt.git] / apt-pkg / packagemanager.cc
index de7f410e6076e7bf28197c3f2826eb8d37bcd60c..ac11b5d5153f6304459a2a10d9cb066a9d41128c 100644 (file)
@@ -278,7 +278,7 @@ bool pkgPackageManager::ConfigureAll()
    {
       PkgIterator Pkg(Cache,*I);
 
-      if (ConfigurePkgs == true && VerifyConfigure(Pkg) == false)
+      if (ConfigurePkgs == true && VerifyAndConfigure(Pkg,OList) == false)
         return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -313,7 +313,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
    {
       PkgIterator Pkg(Cache,*I);
       
-      if (ConfigurePkgs == true && VerifyConfigure(Pkg) == false)
+      if (ConfigurePkgs == true && VerifyAndConfigure(Pkg,OList) == false)
         return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -379,14 +379,12 @@ bool pkgPackageManager::VerifyConfigure(PkgIterator Pkg, pkgOrderList &OList)
            VerIterator DepInstallVer(Cache,Cache[DepPkg].InstallVer);
            
            if (DepPkg.CurrentVer() == DepVer && !List->IsFlag(DepPkg,pkgOrderList::UnPacked)) {
-              clog << "Version " << DepPkg.CurrentVer() << " is installed on the system, satifying this dependancy" << endl;
               error=false;
               break;
            }
            
            if (Cache[DepPkg].InstallVer == DepVer && 
               (List->IsFlag(DepPkg,pkgOrderList::Configured) || OList.IsFlag(DepPkg,pkgOrderList::InList))) {
-              clog << "Version " << DepInstallVer.VerStr() << " is going to be installed on the system, satifying this dependancy" << endl;
               error=false;
               break;
            }
@@ -418,7 +416,7 @@ bool pkgPackageManager::VerifyConfigure(PkgIterator Pkg, pkgOrderList &OList)
    configures it  */
 bool pkgPackageManager::VerifyAndConfigure(PkgIterator Pkg, pkgOrderList &OList)
 {
-   if (VerifyConfigure(Pkg, OList))
+   if (VerifyConfigure(Pkg, OList)) 
       return Configure(Pkg);
    else
       return false;
@@ -577,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)
@@ -676,6 +677,21 @@ 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();
+           // Check if it needs to be unpacked
+           if (List->IsFlag(Pkg,pkgOrderList::InList) && Cache[Pkg].Delete() == false) {
+             // Found a break, so unpack the package
+             SmartUnPack(Pkg, false);
+           }
+        }
+      }
    }
 
    // Check for reverse conflicts.