Procházet zdrojové kódy

do not enter an endless loop for (essential) pre-dependency loops

David Kalnischkies před 14 roky
rodič
revize
d9f6c79566
2 změnil soubory, kde provedl 19 přidání a 13 odebrání
  1. 17 12
      apt-pkg/packagemanager.cc
  2. 2 1
      debian/changelog

+ 17 - 12
apt-pkg/packagemanager.cc

@@ -404,22 +404,27 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
 	 
 	 /* If the dependany is still not satisfied, try, if possible, unpacking a package to satisfy it */
 	 if (InstallVer != 0 && Bad) {
-	    Bad = false;
-	    if (List->IsNow(DepPkg) && !List->IsFlag(DepPkg,pkgOrderList::Loop)) {
-	       List->Flag(Pkg,pkgOrderList::Loop);
-	       if (Debug) 
-	          cout << OutputInDepth(Depth) << "Unpacking " << DepPkg.Name() << " to avoid loop" << endl;
-	       SmartUnPack(DepPkg, true, Depth + 1);
-	       List->RmFlag(Pkg,pkgOrderList::Loop);
+	    if (List->IsNow(DepPkg)) {
+	       Bad = false;
+	       if (List->IsFlag(Pkg,pkgOrderList::Loop))
+	       {
+		  if (Debug)
+		     std::clog << OutputInDepth(Depth) << "Package " << Pkg << " loops in SmartConfigure" << std::endl;
+	       }
+	       else
+	       {
+		  List->Flag(Pkg,pkgOrderList::Loop);
+		  if (Debug)
+		     cout << OutputInDepth(Depth) << "Unpacking " << DepPkg.Name() << " to avoid loop" << endl;
+		  SmartUnPack(DepPkg, true, Depth + 1);
+		  List->RmFlag(Pkg,pkgOrderList::Loop);
+	       }
 	    }
 	 }
 	 
 	 if (Start==End) {
-	    if (Bad && Debug) {
-	       if (!List->IsFlag(DepPkg,pkgOrderList::Loop)) {
-                  _error->Warning("Could not satisfy dependancies for %s",Pkg.Name());
-               } 
-	    }
+	    if (Bad && Debug && List->IsFlag(DepPkg,pkgOrderList::Loop) == false)
+		  std::clog << OutputInDepth(Depth) << "Could not satisfy dependancies for " << Pkg.Name() << std::endl;
 	    break;
 	 } else {
             Start++;

+ 2 - 1
debian/changelog

@@ -4,10 +4,11 @@ apt (0.8.16~exp8) experimental; urgency=low
   * apt-pkg/packagemanager.cc:
     - do not fail on unpacked packages in SmartUnPack, just don't
       shedule them for unpack, but do all checks and configure them
+    - do not enter an endless loop for (essential) pre-dependency loops
   * apt-pkg/contrib/sha2_internal.cc:
     - use a pointer-union to peace gcc strict-aliasing warning
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 30 Oct 2011 14:15:53 -0500
+ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 31 Oct 2011 14:34:48 -0500
 
 apt (0.8.16~exp7) experimental; urgency=low