]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-cacheset.cc
The following command otherwise yields many blank lines:
[apt.git] / apt-private / private-cacheset.cc
index 4a63c7e8178756d1fc433b98014850e6d0be31e5..e37e7b227455e7a44aebc76a2a71d0a1ba203e6c 100644 (file)
@@ -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();