summaryrefslogtreecommitdiff
path: root/cmdline/cacheset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/cacheset.cc')
-rw-r--r--cmdline/cacheset.cc7
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);