* doc/apt-get.8.xml:
[ntk/apt.git] / apt-pkg / packagemanager.cc
index db88272..eef79cc 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;
+
+   if (Debug) 
+      std::clog << OutputInDepth(Depth) << "DepAdd: " << Pkg.Name() << std::endl;
       
    // 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 (Debug) 
+           std::clog << OutputInDepth(Depth) << "DepAdd FAILS on: " << Pkg.Name() << std::endl;
         OList.Flag(Pkg,0,pkgOrderList::Added);
         OList.pop_back();
         Depth--;
@@ -470,6 +475,8 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
 
    if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false)
       return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
+   else
+      return SmartRemove(Pkg.Group().FindPkg("all"));
    return true;
 }
                                                                        /*}}}*/
@@ -584,11 +591,22 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
    for (PrvIterator P = Cache[Pkg].InstVerIter(Cache).ProvidesList(); 
        P.end() == false; P++)
       CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
-   
-   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false &&
-       Install(Pkg,FileNames[Pkg->ID]) == false)
-      return false;
-   
+
+   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false)
+   {
+      if(Install(Pkg,FileNames[Pkg->ID]) == 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.