diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:57 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:57 +0000 |
commit | 6aeda9fa854fce99ecda5331e69b782b711bed74 (patch) | |
tree | 87e496d12f38b3ef288dcafb92f681e4cf09a065 /apt-pkg/policy.cc | |
parent | c82ffeb66a6a4de0b672ac80fcb4955022e7a615 (diff) | |
download | apt-6aeda9fa854fce99ecda5331e69b782b711bed74.tar.gz |
Bug 87390
Author: jgg
Date: 2001-03-03 23:27:24 GMT
Bug 87390
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 029a37df7..e813a0903 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: policy.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $ +// $Id: policy.cc,v 1.3 2001/03/03 23:27:24 jgg Exp $ /* ###################################################################### Package Version Policy implementation @@ -145,9 +145,23 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg) pin that stays at that setting. */ for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; Ver++) - { + { + /* This is a side effect of the condition below, and is added for + completeness, though it should not be necessary */ + if (Ver->Arch == 0) + continue; + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) { + /* If this is the status file, and the current version is not the + version in the status file (ie it is not installed, or somesuch) + then it is not a candidate for installation, ever. This weeds + out bogus entries that may be due to config-file states, or + other. */ + if ((VF.File()->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource && + Pkg.CurrentVer() != Ver) + continue; + signed Prio = PFPriority[VF.File()->ID]; if (Prio > Max) { |