]> git.saurik.com Git - apt.git/blobdiff - cmdline/cacheset.cc
* cmdline/apt-cache.cc:
[apt.git] / cmdline / cacheset.cc
index b96b604508f32ca2fd5fc19198d5e9ccce6b5fe9..78c9d3f6c8a90878b63b69f9e005db73c42f4d8a 100644 (file)
@@ -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);