diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:29 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:29 +0000 |
commit | fcf85120ef8c7e953a23a49768c0d5b84385efcd (patch) | |
tree | 4156c4cf7a0ce05df5ac08a7759ad978d6547bb8 | |
parent | 3e3221bad5ad56ef36a2ca4f9f44949b042935b5 (diff) |
Slightly tweaked problem resolver
Author: jgg
Date: 1998-11-14 03:32:36 GMT
Slightly tweaked problem resolver
-rw-r--r-- | apt-pkg/algorithms.cc | 18 |
1 files changed, 14 insertions, 4 deletions
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++) { |