diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-07-04 00:32:52 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-07-04 00:32:52 +0200 |
commit | 2fbfb111312257fa5fc29b0c2ed386fb712f960e (patch) | |
tree | 89eb4ec06fcf41a8927b4347c86e2f342922ce21 /cmdline/cacheset.cc | |
parent | 21d4c9f192b5af9c8edb39356712aac853881348 (diff) |
prefer the Policy if it is built instead of the DepCache and
if DepCache is not available as fallback built the Policy
Diffstat (limited to 'cmdline/cacheset.cc')
-rw-r--r-- | cmdline/cacheset.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdline/cacheset.cc b/cmdline/cacheset.cc index b96b60450..78c9d3f6c 100644 --- a/cmdline/cacheset.cc +++ b/cmdline/cacheset.cc @@ -416,12 +416,13 @@ VersionSet VersionSet::FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator co pkgCache::VerIterator VersionSet::getCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper) { pkgCache::VerIterator Cand; - if (Cache.IsDepCacheBuilt() == true) - Cand = Cache[Pkg].CandidateVerIter(Cache); - else { + if (Cache.IsPolicyBuilt() == true || Cache.IsDepCacheBuilt() == false) + { if (unlikely(Cache.GetPolicy() == 0)) return pkgCache::VerIterator(Cache); Cand = Cache.GetPolicy()->GetCandidateVer(Pkg); + } else { + Cand = Cache[Pkg].CandidateVerIter(Cache); } if (Cand.end() == true) return helper.canNotFindCandidateVer(Cache, Pkg); |