]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/orderlist.cc
* Removed the more leftover #pragma interface/implementation
[apt.git] / apt-pkg / orderlist.cc
index 1f64db908a992b09436c0652d667f1635764802d..616714e2927f4cb4a674be6e9cfdba802b3f5b37 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: orderlist.cc,v 1.13 2001/04/27 04:47:58 jgg Exp $
+// $Id: orderlist.cc,v 1.14 2001/05/07 05:49:43 jgg Exp $
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/orderlist.h"
-#endif 
 #include <apt-pkg/orderlist.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/version.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/configuration.h>
+
+#include <iostream>
                                                                        /*}}}*/
 
+using namespace std;
+
 pkgOrderList *pkgOrderList::Me = 0;
 
 // OrderList::pkgOrderList - Constructor                               /*{{{*/
@@ -487,11 +488,13 @@ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical)
         continue;
       
       if (D->Type != pkgCache::Dep::Conflicts &&
+         D->Type != pkgCache::Dep::DpkgBreaks &&
          D->Type != pkgCache::Dep::Obsoletes &&
          Cache[Pkg].InstallVer != *I)
         continue;
       
       if ((D->Type == pkgCache::Dep::Conflicts ||
+          D->Type == pkgCache::Dep::DpkgBreaks ||
           D->Type == pkgCache::Dep::Obsoletes) &&
          (Version *)Pkg.CurrentVer() != *I)
         continue;
@@ -626,6 +629,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 &&
             D->Type != pkgCache::Dep::PreDepends)
            continue;
@@ -664,7 +668,7 @@ bool pkgOrderList::DepUnPackCrit(DepIterator D)
    }   
    return true;
 }
-                                                                       /*}}}*/
+
 // OrderList::DepUnPackPreD - Critical UnPacking ordering with depends /*{{{*/
 // ---------------------------------------------------------------------
 /* Critical PreDepends (also configure immediate and essential) strives to
@@ -799,9 +803,20 @@ bool pkgOrderList::DepUnPackDep(DepIterator D)
               return false;
         }
         else
+        {
            if (D->Type == pkgCache::Dep::Depends)
               if (VisitProvides(D,false) == false)
                  return false;
+
+           if (D->Type == pkgCache::Dep::DpkgBreaks)
+           {
+              if (CheckDep(D) == true)
+                continue;
+
+              if (VisitNode(D.TargetPkg()) == false)
+                return false;
+           }
+        }
       }
    return true;
 }
@@ -949,6 +964,7 @@ 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)
       {
         /* Try to find something that does not have the after flag set