]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/packagemanager.{cc,h}:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 3 Jan 2008 10:25:58 +0000 (11:25 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 3 Jan 2008 10:25:58 +0000 (11:25 +0100)
  - propergate the Immediate flag to make hitting the
    "E: Internal Error, Could not perform immediate configuration (2)"
    harder

apt-pkg/packagemanager.cc
apt-pkg/packagemanager.h
debian/changelog

index d6172c6c4c8cd82197b1dd9c95467ab2666ccf3b..c391a6036915e2f78b26591e46624465e0e23c24 100644 (file)
@@ -118,6 +118,41 @@ bool pkgPackageManager::FixMissing()
 }
                                                                        /*}}}*/
 
+// PM::ImmediateAdd - Add the immediate flag recursivly                        /*{{{*/
+// ---------------------------------------------------------------------
+/* This adds the immediate flag to the pkg and recursively to the
+   dependendies 
+ */
+void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer)
+{
+   DepIterator D;
+   
+   if(UseInstallVer)
+   {
+      if(Cache[I].InstallVer == 0)
+        return;
+      D = Cache[I].InstVerIter(Cache).DependsList(); 
+   } else {
+      if (I->CurrentVer == 0)
+        return;
+      D = I.CurrentVer().DependsList(); 
+   }
+
+   for ( /* nothing */  ; D.end() == false; D++)
+      if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
+      {
+        if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
+        {
+           if(Debug)
+              clog << "ImmediateAdd(): Adding Immediate flag to " << I.Name() << endl;
+           List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+           ImmediateAdd(D.TargetPkg(), UseInstallVer);
+        }
+      }
+   return;
+}
+                                                                       /*}}}*/
+
 // PM::CreateOrderList - Create the ordering class                     /*{{{*/
 // ---------------------------------------------------------------------
 /* This populates the ordering list with all the packages that are
@@ -144,21 +179,15 @@ bool pkgPackageManager::CreateOrderList()
           (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
          NoImmConfigure == false)
       {
+        if(Debug)
+           clog << "CreateOrderList(): Adding Immediate flag for " << I.Name() << endl;
         List->Flag(I,pkgOrderList::Immediate);
-        
-        // Look for other packages to make immediate configurea
-        if (Cache[I].InstallVer != 0)
-           for (DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); 
-                D.end() == false; D++)
-              if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
-                 List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+
+        // Look for other install packages to make immediate configurea
+        ImmediateAdd(I, true);
         
         // And again with the current version.
-        if (I->CurrentVer != 0)
-           for (DepIterator D = I.CurrentVer().DependsList(); 
-                D.end() == false; D++)
-              if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
-                 List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+        ImmediateAdd(I, false);
       }
       
       // Not interesting
index 53cd4c96ffc24ce93868fbb7505480a2bc363a06..a1bfdc52d7072a8a947c4511887168a88df9eaba 100644 (file)
@@ -49,6 +49,7 @@ class pkgPackageManager : protected pkgCache::Namespace
    bool Debug;
          
    bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0);
+   void ImmediateAdd(PkgIterator P, bool UseInstallVer);
    virtual OrderResult OrderInstall();
    bool CheckRConflicts(PkgIterator Pkg,DepIterator Dep,const char *Ver);
    bool CreateOrderList();
index ef9784178646a042cab658d4ad5d7c122cc99e08..4f22e9d923663c811b684aac48a91ce21f82af72 100644 (file)
@@ -43,6 +43,10 @@ apt (0.7.10) UNRELEASED; urgency=low
   * apt-pkg/acquire-item.{cc,h}:
     - make the authentication download code more robust against
       servers/proxies with broken If-Range implementations
+  * apt-pkg/packagemanager.{cc,h}:
+    - propergate the Immediate flag to make hitting the 
+      "E: Internal Error, Could not perform immediate configuration (2)"
+      harder
 
   [ Chris Cheney ]
   * ftparchive/contents.cc: