Comment 6 for bug 1876495

Revision history for this message
Julian Andres Klode (juliank) wrote :

There are two hilarious bugs in here:

(1) We call _config->FindB("APT::Cache::AllNames","false"), trying to set the default to false, but we pass a char* instead, which gets cast to true (as it's != nullptr). So, pkgnames always runs with --all-names

(2) We accidentally exclude virtual packages, hence why we've not seen that before by excluding any package that does not have a version, by checking I.FindPkg("any")->VersionList == 0.

Now the trick here is that the check in (2) fails for source packages, as I.FindPkg("any") does not find a valid package (it returns a pointer to the start of the cache), but that generates a != 0 VersionList.

Anyway, I've got the fix.