Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269175 - [PATCH] gentoolkit-0.3.0_rc5 - helpers2._do_simple_lookup doesn't find masked packages
Summary: [PATCH] gentoolkit-0.3.0_rc5 - helpers2._do_simple_lookup doesn't find masked...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2009-05-09 19:19 UTC by Douglas Anderson
Modified: 2009-06-19 17:13 UTC (History)
1 user (show)

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


Attachments
Include masked packages in helpers2._do_simple_lookup (gentoolkit-helpers2-include_masked.patch,436 bytes, patch)
2009-05-10 00:58 UTC, Douglas Anderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Anderson 2009-05-09 19:19:36 UTC
The do_lookup function in helpers2 was not including masked packages for simple (string or atom) lookups.

pre-patch:
dja@vault ~ $ equery l -p dvbcut
 * Searching for dvbcut ...
 * Portage tree (/usr/portage):

post-patch: 
dja@vault ~ $ equery l -p dvbcut
 * Searching for dvbcut ...
 * Portage tree (/usr/portage):
[-P-] [M~] media-video/dvbcut-0.5.4-r1 (0)
Comment 1 Douglas Anderson 2009-05-10 00:58:39 UTC
Created attachment 190802 [details, diff]
Include masked packages in helpers2._do_simple_lookup
Comment 2 Daniel Pielmeier gentoo-dev 2009-05-10 13:05:15 UTC
I think it is more than that. I did some observations and found the following out:

Output of eix for the tested packages:

> eix -I cut
> [I] media-video/dvbcut
>      Available versions:  (~)0.5.4-r1 (~)0.6.0[1] **9999[1]
>      Installed versions:  0.6.0[1](15:09:37 09.05.2009)
> 
> [I] media-video/ttcut
>      Available versions:  0.19.6-r1 0.19.6-r1[1] **9999 **9999[1]
>      Installed versions:  0.19.6-r1[1](09:07:44 21.03.2009)
> 
> [1] "gentoo-billie" /media/system/repositories/portage-billie

So I expect "equery l" to give me three results for dvbcut one from the portage tree and two from my overlay. Same for ttcut two results for the portage tree and two results for my overlay.

This is what I get unpatched:

> equery l -p ttcut
>  * Searching for ttcut ...
>  * Portage tree (/media/system/repositories/portage):
> 
> equery l -p dvbcut
>  * Searching for dvbcut ...
>  * Portage tree (/media/system/repositories/portage):
> [-P-] [ ~] media-video/dvbcut-0.5.4-r1 (0)

Nothing changed with the patch applied:

> equery l -p ttcut
>  * Searching for ttcut ...
>  * Portage tree (/media/system/repositories/portage):
> 
> equery l -p dvbcut
>  * Searching for dvbcut ...
>  * Portage tree (/media/system/repositories/portage):
> [-P-] [ ~] media-video/dvbcut-0.5.4-r1 (0)

If I temporarily rename the packages in my overlay I expect equery to give me at least the results for the portage tree. One result for dvbcut and two results for ttcut.

mv dvbcut/ dvbcu && mv ttcut ttcu

But I get unpatched:

> equery l -p ttcut
>  * Searching for ttcut ...
>  * Portage tree (/media/system/repositories/portage):
> 
> equery l -p dvbcut
>  * Searching for dvbcut ...
>  * Portage tree (/media/system/repositories/portage):
> [-P-] [ ~] media-video/dvbcut-0.5.4-r1 (0)

And patched:

> equery l -p ttcut
>  * Searching for ttcut ...
>  * Portage tree (/media/system/repositories/portage):
> [-P-] [M ] media-video/ttcut-9999 (0)
> 
> equery l -p dvbcut
>  * Searching for dvbcut ...
>  * Portage tree (/media/system/repositories/portage):
> [-P-] [ ~] media-video/dvbcut-0.5.4-r1 (0)

So even with no overlays the output for ttcut is wrong as it only shows the masked version. If overlays come into play equery is even more confused especially if there are packages with the same version also in the portage tree.
Comment 3 Douglas Anderson 2009-05-10 16:22:48 UTC
The patched output looks correct to me.

There have been a few slight changes in the way equery list handles the options. I regret that changes aren't reflected in the man page yet. There's a bug open for that (bug 269071).

When you search with no options, it defaults to searching for installed files:
$ equery l gentoolkit
 * Searching for gentoolkit ...
 * installed packages:
[I--] [ ~] app-portage/gentoolkit-0.3.0_rc5 (0)

Then, if you specify a search location (either -p or -o, it will ONLY search where you're asking it to... equivalent to gentoolkit-0.2*'s equery list -pI something). 
$ equery l -p gentoolkit
 * Searching for gentoolkit ...
 * Portage tree (/usr/portage):
[-P-] [M ] app-portage/gentoolkit-0.2.4_pre8 (0)
[-P-] [  ] app-portage/gentoolkit-0.2.4.2-r1 (0)
[-P-] [ ~] app-portage/gentoolkit-0.2.4.3 (0)

Notice it didn't list the installed version. This definition of "portage tree" is consistent with older versions of equery, where it means the set of packages in the portage tree minus the VDB. I think that's a bit confusing, but that's historically what "portage tree" is in equery. The only difference is that it now only gives you what you ask for. To include installed with it, you have to add the -i option:
$ equery l -pi gentoolkit
 * Searching for gentoolkit ...
 * installed packages:
[I--] [ ~] app-portage/gentoolkit-0.3.0_rc5 (0)
 * Portage tree (/usr/portage):
[-P-] [M ] app-portage/gentoolkit-0.2.4_pre8 (0)
[-P-] [  ] app-portage/gentoolkit-0.2.4.2-r1 (0)
[-P-] [ ~] app-portage/gentoolkit-0.2.4.3 (0)

And lastly, to include versions in an overlay, use the -o option. This is also consistent with older version of equery:
$ equery l -pio gentoolkit
 * Searching for gentoolkit ...
 * installed packages:
[I--] [ ~] app-portage/gentoolkit-0.3.0_rc5 (0)
 * Portage tree (/usr/portage):
[-P-] [M ] app-portage/gentoolkit-0.2.4_pre8 (0)
[-P-] [  ] app-portage/gentoolkit-0.2.4.2-r1 (0)
[-P-] [ ~] app-portage/gentoolkit-0.2.4.3 (0)
 * overlay tree (/usr/local/portage/layman/genscripts /usr/local/portage/layman/sunrise /usr/local/portage/layman/xwing /usr/local/portage):
[--O] [ ~] app-portage/gentoolkit-0.2.5_rc10 (0)
[--O] [ ~] app-portage/gentoolkit-0.3.0_rc2 (0)
[--O] [ ~] app-portage/gentoolkit-0.3.0_rc4 (0)
Comment 4 Douglas Anderson 2009-05-10 16:32:54 UTC
Thinking about this more, I think it would actually be better to get rid of -i altogether and make only have -I, and not even have an "* installed packages" heading, because being installed doesn't exclude a package from being in overlay or porttree, as equery has traditionally handled it. It would be a lot more intuitive if the output were something like:

$ equery l -po gentoolkit
 * Searching for gentoolkit ...
 * Portage tree (/usr/portage):
[-P-] [M ] app-portage/gentoolkit-0.2.4_pre8 (0)
[-P-] [  ] app-portage/gentoolkit-0.2.4.2-r1 (0)
[-P-] [ ~] app-portage/gentoolkit-0.2.4.3 (0)
[IP-] [ ~] app-portage/gentoolkit-0.3.0_rc5 (0)
 * overlay tree (...):
[--O] [ ~] app-portage/gentoolkit-0.2.5_rc10 (0)
[--O] [ ~] app-portage/gentoolkit-0.3.0_rc2 (0)
[--O] [ ~] app-portage/gentoolkit-0.3.0_rc4 (0)

With the installed indicator marked alongside P or O. That would take some work, but I think it makes a lot more sense. 
Comment 5 Daniel Pielmeier gentoo-dev 2009-05-10 16:44:57 UTC
Thank you for your explanations. I should have read the output of --help more carefully :-)

I think getting rid of the -i option is a good idea and just indicate the installed package in the output like you mentioned above.
Comment 6 Douglas Anderson 2009-06-06 06:13:08 UTC
(In reply to comment #5)
> Thank you for your explanations. I should have read the output of --help more
> carefully :-)
> 
> I think getting rid of the -i option is a good idea and just indicate the
> installed package in the output like you mentioned above.
> 

Current svn version uses this idea, output is a lot more compact and readable. Also try `equery --quiet list` in svn for an even more compact output (and it can speed things up in certain situations).

These improvements will be available in gentoolkit-0.3.0_rc7.
Comment 7 Paul Varner (RETIRED) gentoo-dev 2009-06-19 17:13:47 UTC
Released in gentoolkit-0.3.0_rc7