From c8259fcde18ad9e08fffb04bf06ed64b87b1ac6a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 8 Apr 2014 09:04:15 +0200 Subject: 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. --- apt-private/private-output.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-private/private-output.cc') diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index bbd8545ad..757999167 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -146,6 +146,10 @@ static std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterato pkgCache::VerIterator inst = P.CurrentVer(); pkgCache::VerIterator cand = policy->GetCandidateVer(P); + // this may happen for packages in dpkg "deinstall ok config-file" state + if (inst.IsGood() == false && cand.IsGood() == false) + return P.VersionList().Arch(); + return inst ? inst.Arch() : cand.Arch(); } /*}}}*/ -- cgit v1.2.3