]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/orderlist.cc
* apt-pkg/pkgcachegen.{cc,h}:
[apt.git] / apt-pkg / orderlist.cc
index 602b63d3b6c5d761a92c4eb00a21f07280be1e39..19661fc2dfb7fc151b6e458d90620aeb3f6b2278 100644 (file)
@@ -128,10 +128,6 @@ bool pkgOrderList::IsMissing(PkgIterator Pkg)
    if (FileList[Pkg->ID].empty() == false)
       return false;
 
-   // Missing Pseudo packages are missing if the real package is missing
-   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == true)
-      return IsMissing(Pkg.Group().FindPkg("all"));
-
    return true;
 }
                                                                        /*}}}*/
@@ -494,7 +490,7 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver)
    bool Res = true;
    for (PrvIterator P = Ver.ProvidesList(); P.end() == false; P++)
       Res &= (this->*F)(P.ParentPkg().RevDependsList());
-   return true;
+   return Res;
 }
                                                                        /*}}}*/
 // OrderList::VisitProvides - Visit all of the providing packages      /*{{{*/
@@ -511,15 +507,11 @@ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical)
       if (Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing)
         continue;
       
-      if (D->Type != pkgCache::Dep::Conflicts &&
-         D->Type != pkgCache::Dep::DpkgBreaks &&
-         D->Type != pkgCache::Dep::Obsoletes &&
+      if (D.IsNegative() == false &&
          Cache[Pkg].InstallVer != *I)
         continue;
       
-      if ((D->Type == pkgCache::Dep::Conflicts ||
-          D->Type == pkgCache::Dep::DpkgBreaks ||
-          D->Type == pkgCache::Dep::Obsoletes) &&
+      if (D.IsNegative() == true &&
          (Version *)Pkg.CurrentVer() != *I)
         continue;
       
@@ -651,9 +643,7 @@ bool pkgOrderList::DepUnPackCrit(DepIterator D)
       {
         /* Forward critical dependencies MUST be correct before the 
            package can be unpacked. */
-        if (D->Type != pkgCache::Dep::Conflicts &&
-            D->Type != pkgCache::Dep::DpkgBreaks &&
-            D->Type != pkgCache::Dep::Obsoletes &&
+        if (D.IsNegative() == false &&
             D->Type != pkgCache::Dep::PreDepends)
            continue;
                                 
@@ -967,13 +957,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;
@@ -1061,10 +1071,14 @@ bool pkgOrderList::CheckDep(DepIterator D)
       
       /* Conflicts requires that all versions are not present, depends
          just needs one */
-      if (D->Type != pkgCache::Dep::Conflicts && 
-         D->Type != pkgCache::Dep::DpkgBreaks && 
-         D->Type != pkgCache::Dep::Obsoletes)
+      if (D.IsNegative() == false)
       {
+        // ignore provides by older versions of this package
+        if (((D.Reverse() == false && Pkg == D.ParentPkg()) ||
+             (D.Reverse() == true && Pkg == D.TargetPkg())) &&
+            Cache[Pkg].InstallVer != *I)
+           continue;
+
         /* Try to find something that does not have the after flag set
            if at all possible */
         if (IsFlag(Pkg,After) == true)