]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/orderlist.cc
add options to disable specific checksums for Indexes
[apt.git] / apt-pkg / orderlist.cc
index cb55147c3640da1105acc08c7479fab021377e56..a53854a2687124eff9a10791e0c65a7c6923471c 100644 (file)
@@ -936,6 +936,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
                            Cache[P].InstallVer != 0 &&
                            VisitNode(P) == true)
                        {
+                          Flag(P, Immediate);
                           tryFixDeps = false;
                           break;
                        }
@@ -966,12 +967,33 @@ bool pkgOrderList::DepRemove(DepIterator D)
               // start again in the or group and find something which will serve as replacement
               for (; F.end() == false && F != S; ++F)
               {
-                 if (F.TargetPkg() == D.TargetPkg() ||
-                     IsFlag(F.TargetPkg(), InList) == false ||
-                     VisitNode(F.TargetPkg()) == false)
-                    continue;
-                 tryFixDeps = false;
-                 break;
+                 if (IsFlag(F.TargetPkg(), InList) == true &&
+                     IsFlag(F.TargetPkg(), AddPending) == false &&
+                     Cache[F.TargetPkg()].InstallVer != 0 &&
+                     VisitNode(F.TargetPkg()) == true)
+                 {
+                    Flag(F.TargetPkg(), Immediate);
+                    tryFixDeps = false;
+                    break;
+                 }
+                 else if (F.TargetPkg()->ProvidesList != 0)
+                 {
+                    pkgCache::PrvIterator Prv = F.TargetPkg().ProvidesList();
+                    for (; Prv.end() == false; ++Prv)
+                    {
+                       if (IsFlag(Prv.OwnerPkg(), InList) == true &&
+                           IsFlag(Prv.OwnerPkg(), AddPending) == false &&
+                           Cache[Prv.OwnerPkg()].InstallVer != 0 &&
+                           VisitNode(Prv.OwnerPkg()) == true)
+                       {
+                          Flag(Prv.OwnerPkg(), Immediate);
+                          tryFixDeps = false;
+                          break;
+                       }
+                    }
+                    if (Prv.end() == false)
+                       break;
+                 }
               }
               if (tryFixDeps == false)
                  break;