]> git.saurik.com Git - apt.git/commitdiff
Slightly tweaked problem resolver
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:51:29 +0000 (16:51 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:51:29 +0000 (16:51 +0000)
Author: jgg
Date: 1998-11-14 03:32:36 GMT
Slightly tweaked problem resolver

apt-pkg/algorithms.cc

index a65062a9bc7ff8d25a97bacf11b91754601c8c21..c419022ff56bc6d399a959cd34750f1c74e5a056 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: algorithms.cc,v 1.9 1998/11/13 07:08:57 jgg Exp $
+// $Id: algorithms.cc,v 1.10 1998/11/14 03:32:36 jgg Exp $
 /* ######################################################################
 
    Algorithms - A set of misc algorithms
@@ -700,10 +700,20 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
                    
            if (Debug == true)
               clog << "Package " << I.Name() << " has broken dep on " << End.TargetPkg().Name() << endl;
-           
-           /* Conflicts is simple, decide if we should remove this package
-              or the conflicted one */
+
+           /* Look across the version list. If there are no possible
+              targets then we keep the package and bail. This is necessary
+              if a package has a dep on another package that cant be found */
            pkgCache::Version **VList = End.AllTargets();
+           if (*VList == 0 && (Flags[I->ID] & Protected) != Protected &&
+               End->Type != pkgCache::Dep::Conflicts && 
+               Cache[I].NowBroken() == false)
+           {
+              Change = true;
+              Cache.MarkKeep(I);
+              break;
+           }
+           
            bool Done = false;
            for (pkgCache::Version **V = VList; *V != 0; V++)
            {