From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:29 +0000 (+0000) Subject: Slightly tweaked problem resolver X-Git-Tag: 0.7.24ubuntu1~1629 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/fcf85120ef8c7e953a23a49768c0d5b84385efcd Slightly tweaked problem resolver Author: jgg Date: 1998-11-14 03:32:36 GMT Slightly tweaked problem resolver --- diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index a65062a9b..c419022ff 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -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++) {