summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/policy.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 8fadc9fa0..2298e7edc 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -172,17 +172,20 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk
// never sources, ignore it.
if (!Pref.end())
{
+ bool IsAvailable = false;
bool AllNever = true;
for (pkgCache::VerFileIterator VF = Pref.FileList(); VF.end() == false; ++VF)
{
if ((VF.File()->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
continue;
+ IsAvailable = true;
+
if (PFPriority[VF.File()->ID] != NEVER_PIN)
AllNever = false;
}
- if (AllNever)
+ if (IsAvailable && AllNever)
Pref = pkgCache::VerIterator(*Pkg.Cache());
}