]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
rewrite the pseudo package reinstaller to be more intelligent
[apt.git] / apt-pkg / packagemanager.cc
index 35cc245509e24c34d7e54ecb106dbf1be3886bcc..eef79cccd381443da9de4a702c4eb555cf9a61ef 100644 (file)
@@ -345,6 +345,9 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
       return true;
    if (List->IsFlag(Pkg,pkgOrderList::UnPacked) == false)
       return false;
       return true;
    if (List->IsFlag(Pkg,pkgOrderList::UnPacked) == false)
       return false;
+
+   if (Debug) 
+      std::clog << OutputInDepth(Depth) << "DepAdd: " << Pkg.Name() << std::endl;
       
    // Put the package on the list
    OList.push_back(Pkg);
       
    // Put the package on the list
    OList.push_back(Pkg);
@@ -398,6 +401,8 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
       
       if (Bad == true)
       {
       
       if (Bad == true)
       {
+        if (Debug) 
+           std::clog << OutputInDepth(Depth) << "DepAdd FAILS on: " << Pkg.Name() << std::endl;
         OList.Flag(Pkg,0,pkgOrderList::Added);
         OList.pop_back();
         Depth--;
         OList.Flag(Pkg,0,pkgOrderList::Added);
         OList.pop_back();
         Depth--;
@@ -591,9 +596,17 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
    {
       if(Install(Pkg,FileNames[Pkg->ID]) == false)
          return false;
    {
       if(Install(Pkg,FileNames[Pkg->ID]) == false)
          return false;
-   } else if (SmartUnPack(Pkg.Group().FindPkg("all")) == false)
-      return false;
-
+   } else {
+      // Pseudo packages will not be unpacked - instead we will do this
+      // for the "real" package, but only once and if it is already
+      // configured we don't need to unpack it again…
+      PkgIterator const P = Pkg.Group().FindPkg("all");
+      if (List->IsFlag(P,pkgOrderList::UnPacked) != true &&
+         List->IsFlag(P,pkgOrderList::Configured) != true) {
+        if (SmartUnPack(P) == false)
+           return false;
+      }
+   }
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
    
    // Perform immedate configuration of the package.
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
    
    // Perform immedate configuration of the package.