]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
ensure that the right architecture is used for cross-dependencies in
[apt.git] / apt-pkg / packagemanager.cc
index 093999bc243e66da1727838bfaf25a46f31f4200..b93bf6ab9e5fb2302c24a5e70838d6448fcd7352 100644 (file)
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/sptr.h>
 
-#include <apti18n.h>
 #include <iostream>
 #include <fcntl.h>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 using namespace std;
 
@@ -621,7 +622,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
            // Look for easy targets: packages that are already okay
            for (DepIterator Cur = Start; Bad == true; ++Cur)
            {
-              SPtrArray<Version *> VList = Start.AllTargets();
+              SPtrArray<Version *> VList = Cur.AllTargets();
               for (Version **I = VList; *I != 0; ++I)
               {
                  VerIterator Ver(Cache,*I);
@@ -642,9 +643,9 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
            }
 
            // Look for something that could be configured.
-           for (DepIterator Cur = Start; Bad == true; ++Cur)
+           for (DepIterator Cur = Start; Bad == true && Cur.end() == false; ++Cur)
            {
-              SPtrArray<Version *> VList = Start.AllTargets();
+              SPtrArray<Version *> VList = Cur.AllTargets();
               for (Version **I = VList; *I != 0; ++I)
               {
                  VerIterator Ver(Cache,*I);
@@ -784,7 +785,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
                           VerIterator V(Cache,*I);
                           PkgIterator P = V.ParentPkg();
                           // we are checking for installation as an easy 'protection' against or-groups and (unchosen) providers
-                          if (P->CurrentVer == 0 || P != Pkg || (P.CurrentVer() != V && Cache[P].InstallVer != V))
+                          if (P != Pkg || (P.CurrentVer() != V && Cache[P].InstallVer != V))
                              continue;
                           circle = true;
                           break;