Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 369581 - app-portage/gentoolkit-0.3.0.3: annoying 'equery l' quirk
Summary: app-portage/gentoolkit-0.3.0.3: annoying 'equery l' quirk
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2011-05-31 21:56 UTC by Rafał Mużyło
Modified: 2019-11-24 19:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch that sems to fix this problem (fix_short_sight.patch,666 bytes, patch)
2014-10-18 20:00 UTC, Rafał Mużyło
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Mużyło 2011-05-31 21:56:45 UTC
If an installed ebuild is removed from the tree, 'equery l' lists it with '[??]' annotation, but 'equery l -p' lists only in-tree packages, giving a false impression of package not being installed.
Comment 1 Rafał Mużyło 2011-07-31 12:44:44 UTC
OK, let's change it from "slightly broken" to just "broken".

ls /usr/portage/app-text/ghostscript-gpl/*.ebuild
/usr/portage/app-text/ghostscript-gpl/ghostscript-gpl-8.71-r6.ebuild
/usr/portage/app-text/ghostscript-gpl/ghostscript-gpl-9.00-r1.ebuild
/usr/portage/app-text/ghostscript-gpl/ghostscript-gpl-9.01.ebuild
/usr/portage/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild

equery l -p ghostscript-gpl
 * Searching for ghostscript-gpl ...
[-P-] [  ] app-text/ghostscript-gpl-8.71-r6:0
[-P-] [ ~] app-text/ghostscript-gpl-9.00-r1:0

equery l -p -o ghostscript-gpl
 * Searching for ghostscript-gpl ...
[-P-] [  ] app-text/ghostscript-gpl-8.71-r6:0
[--O] [ ~] app-text/ghostscript-gpl-9.00:0
[-P-] [ ~] app-text/ghostscript-gpl-9.00-r1:0
[--O] [ ~] app-text/ghostscript-gpl-9.01:0
[I-O] [  ] app-text/ghostscript-gpl-9.02:0

That's definitely *not* an expected result.
Looking at the sources, it would seem that it's just listing, that's broken.
If I read the things correctly, in pym/gentoolkit/equery/list_.py, in main(input_args), in 'for pkg in matches' loop, two loop breaking conditions before pp.uprint(pkgstr) incorrectly skip installed packages if they are i.e. no longer in the tree. Note, that if '-l -p' is passed, output is correct, as that negates both of those conditions.
Comment 2 Carsten Milkau 2014-10-17 16:16:38 UTC
Addition: note that even equery -p -i refuses to list packages that have left the tree, which is definitely wrong.

cami ~ # equery l -i firefox
 * Searching for firefox ...
[I--] [??] www-client/firefox-31.0:0
cami ~ # equery l -i -p firefox
 * Searching for firefox ...
[-P-] [ -] www-client/firefox-10.0.11:0
[-P-] [  ] www-client/firefox-17.0.9:0
[-P-] [  ] www-client/firefox-24.3.0:0
[-P-] [  ] www-client/firefox-24.7.0:0
[-P-] [  ] www-client/firefox-24.8.0:0
[-P-] [  ] www-client/firefox-31.1.0-r1:0
[-P-] [ ~] www-client/firefox-32.0:0
cami ~ # equery l -p firefox
 * Searching for firefox ...
[-P-] [ -] www-client/firefox-10.0.11:0
[-P-] [  ] www-client/firefox-17.0.9:0
[-P-] [  ] www-client/firefox-24.3.0:0
[-P-] [  ] www-client/firefox-24.7.0:0
[-P-] [  ] www-client/firefox-24.8.0:0
[-P-] [  ] www-client/firefox-31.1.0-r1:0
[-P-] [ ~] www-client/firefox-32.0:0

cami ~ # equery l gentoolkit
 * Searching for gentoolkit ...
equery l[IP-] [  ] app-portage/gentoolkit-0.3.0.8-r2:0
Comment 3 Rafał Mużyło 2014-10-18 20:00:09 UTC
Created attachment 386910 [details, diff]
patch that sems to fix this problem

TBH, I've just about forgotten I've filed this bug - it's been a few years, after all.

If I understand the current logic correctly, this patch should fix the problem.

It's against 0.3.0.8-r2 - haven't checked ~0.3.0.9.
Comment 4 Rafał Mużyło 2014-10-22 03:20:17 UTC
A little note: reading both the code and my patch a bit more, it becomes clear, that the logic of my patch is wrong, but in this particular context still leads to the correct output.

It simply comes down to the fact, that if '-I' is passed to 'equery l', the query results that go into that patched lop already won't contain installed packages.