]> 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 602b63d3b6c5d761a92c4eb00a21f07280be1e39..a53854a2687124eff9a10791e0c65a7c6923471c 100644 (file)
@@ -967,13 +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;
-                 Flag(F.TargetPkg(), Immediate);
-                 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;