]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/depcache.cc
* add --dsc-only option, thanks to K. Richard Pixley
[apt.git] / apt-pkg / depcache.cc
index d410413d40ad544bd9a1591ccdb17a3d95f3b574..58d1d25e54ed7c2b633f39d69dee14010773589f 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: depcache.cc,v 1.23 2001/02/20 07:03:17 jgg Exp $
+// $Id: depcache.cc,v 1.25 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 
    Dependency Cache - Caches Dependency information.
 /* ######################################################################
 
    Dependency Cache - Caches Dependency information.
@@ -16,7 +16,8 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/algorithms.h>
-    
+#include <apt-pkg/configuration.h>
+
 #include <apti18n.h>    
                                                                        /*}}}*/
 
 #include <apti18n.h>    
                                                                        /*}}}*/
 
@@ -57,8 +58,8 @@ bool pkgDepCache::Init(OpProgress *Prog)
    if (Prog != 0)
    {
       Prog->OverallProgress(0,2*Head().PackageCount,Head().PackageCount,
    if (Prog != 0)
    {
       Prog->OverallProgress(0,2*Head().PackageCount,Head().PackageCount,
-                           _("Building Dependency Tree"));
-      Prog->SubProgress(Head().PackageCount,_("Candidate Versions"));
+                           _("Building dependency tree"));
+      Prog->SubProgress(Head().PackageCount,_("Candidate versions"));
    }
    
    /* Set the current state of everything. In this state all of the
    }
    
    /* Set the current state of everything. In this state all of the
@@ -86,11 +87,14 @@ bool pkgDepCache::Init(OpProgress *Prog)
       
       Prog->OverallProgress(Head().PackageCount,2*Head().PackageCount,
                            Head().PackageCount,
       
       Prog->OverallProgress(Head().PackageCount,2*Head().PackageCount,
                            Head().PackageCount,
-                           _("Building Dependency Tree"));
-      Prog->SubProgress(Head().PackageCount,_("Dependency Generation"));
+                           _("Building dependency tree"));
+      Prog->SubProgress(Head().PackageCount,_("Dependency generation"));
    }
    
    Update(Prog);
    }
    
    Update(Prog);
+
+   if(Prog != 0)
+      Prog->Done();
    
    return true;
 } 
    
    return true;
 } 
@@ -182,6 +186,9 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,signed long Mult)
 {
    StateCache &P = PkgState[Pkg->ID];
    
 {
    StateCache &P = PkgState[Pkg->ID];
    
+   if (Pkg->VersionList == 0)
+      return;
+   
    if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && 
        P.Keep() == true)
       return;
    if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && 
        P.Keep() == true)
       return;
@@ -669,7 +676,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
          succeed. We have already cached this.. */
       for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; Ors--)
         Start++;
          succeed. We have already cached this.. */
       for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; Ors--)
         Start++;
-      
+
       /* This bit is for processing the possibilty of an install/upgrade
          fixing the problem */
       SPtrArray<Version *> List = Start.AllTargets();
       /* This bit is for processing the possibilty of an install/upgrade
          fixing the problem */
       SPtrArray<Version *> List = Start.AllTargets();
@@ -691,7 +698,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
         }
 
         // Select the highest priority providing package
         }
 
         // Select the highest priority providing package
-        if (InstPkg.end() == false)
+        if (InstPkg.end() == true)
         {
            pkgPrioSortList(*Cache,Cur);
            for (; *Cur != 0; Cur++)
         {
            pkgPrioSortList(*Cache,Cur);
            for (; *Cur != 0; Cur++)
@@ -706,6 +713,10 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
         
         if (InstPkg.end() == false)
         {
         
         if (InstPkg.end() == false)
         {
+           if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true)
+              std::clog << "Installing " << InstPkg.Name() 
+                        << " as dep of " << Pkg.Name() 
+                        << std::endl;
            MarkInstall(InstPkg,true,Depth + 1);
 
            // Set the autoflag, after MarkInstall because MarkInstall unsets it
            MarkInstall(InstPkg,true,Depth + 1);
 
            // Set the autoflag, after MarkInstall because MarkInstall unsets it