summaryrefslogtreecommitdiff
path: root/apt-private/private-cacheset.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-04-08 09:04:15 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-04-08 09:04:15 +0200
commitc8259fcde18ad9e08fffb04bf06ed64b87b1ac6a (patch)
treed0ef386f610927be4694099657c32b60889b6ccb /apt-private/private-cacheset.cc
parentd5b21526b38f816974182c5f56db0e09a0446112 (diff)
fix apt list output for pkgs in dpkg ^rc state
Packages in the "deinstall ok config-file" have no candidate or instaleld version. So they must be special cased in the apt list generation.
Diffstat (limited to 'apt-private/private-cacheset.cc')
-rw-r--r--apt-private/private-cacheset.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index 4a63c7e81..e37e7b227 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -73,7 +73,13 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile,
else
{
pkgPolicy *policy = CacheFile.GetPolicy();
- output_set.insert(policy->GetCandidateVer(P));
+ if (policy->GetCandidateVer(P).IsGood())
+ output_set.insert(policy->GetCandidateVer(P));
+ else
+ // no candidate, this may happen for packages in
+ // dpkg "deinstall ok config-file" state - we pick the first ver
+ // (which should be the only one)
+ output_set.insert(P.VersionList());
}
}
progress.Done();