diff options
-rw-r--r-- | cmdline/apt-get.cc | 3 | ||||
-rw-r--r-- | cmdline/cacheset.cc | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 38b93e7e5..9a6c12ee0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -768,6 +768,9 @@ struct TryToInstall { void operator() (pkgCache::VerIterator const &Ver) { pkgCache::PkgIterator Pkg = Ver.ParentPkg(); + +std::clog << "INSTALL " << Pkg << " VER " << Ver.VerStr() << std::endl; + Cache->GetDepCache()->SetCandidateVersion(Ver); pkgDepCache::StateCache &State = (*Cache)[Pkg]; 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); |