Browse Source

prefer the Policy if it is built instead of the DepCache and

if DepCache is not available as fallback built the Policy
tags/debian/0.8.0
David Kalnischkies 11 years ago
parent
commit
2fbfb11131
2 changed files with 7 additions and 3 deletions
  1. +3
    -0
      cmdline/apt-get.cc
  2. +4
    -3
      cmdline/cacheset.cc

+ 3
- 0
cmdline/apt-get.cc View File

@@ -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];



+ 4
- 3
cmdline/cacheset.cc View 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);


Loading…
Cancel
Save