I have written qgrep support for grepping through installed ebuilds (the ones stored in the VDB). The only problem is how to name the option for this feature... The "standard" name (à la qlist) is "-I/--installed", which conflicts with the existing "-I/--invert-match" option. So i have chosen to drop --invert-match support. It sounds a bit extreme, but actually something similar to --invert-match can now be achieved with --skip, so it's not a loss of functionality. I mean, this two commands were equivalent: % qgrep --invert-match foo % qgrep --skip foo "" Sure, if you don't agree this change, then i will rediff without dropping --invert-match, and with a new short option.
Created attachment 114543 [details, diff] qgrep-add_--installed_and_drop_--invert-match.patch Solar, probably this patch will conflict with your qgrep-context-names.diff from bug #172240. Still attaching it for review, but I will rediff later when you have applied yours.
hrmm. I'm not sure about this one. All you have to do now to get this same functionality is. PORTDIR=/var/db/pkg/ qgrep -He virtual/x11
(In reply to comment #2) > hrmm. I'm not sure about this one. All you have to do now to get this same > functionality is. > PORTDIR=/var/db/pkg/ qgrep -He virtual/x11 > Nice trick, i hadn't thought about that. That said, there is still the problem that qgrep will always use the .ebuild.x cache for ebuilds paths. It's ok in /usr/portage, because the sync hook maintains it up-to-date, but for VDB there is nothing like that, which makes this trick less user-friendly than a qgrep option (need to be root, and need to remember deleting /var/db/pkg/.ebuild.x if you have installed/updated anything since last use). Sure, an other option would be to add some post merge/unmerge hooks to maintain a cache in VDB too, but it's a bit over-complicated if only done for that purpose imho.
Created attachment 114556 [details, diff] qgrep-add_--installed_and_drop_--invert-match.patch Rediffed for rev. 1.20
Still not sure about being in love with this one under this approach. Vs all the extra complexity it would seem eaiser to just point portdir at vdbdir. If the .ebuild.x thing you are viewing as a problem then I think we are better off making a fallback there for all applets when no .ebuild.x exists. Like stuffing one in memory or /dev/shm or ~/.ebuild.x or so.
(In reply to comment #5) > Still not sure about being in love with this one under this approach. > Vs all the extra complexity it would seem eaiser to just point portdir at > vdbdir. And I still prefer having an option, i find it more obvious to use. Also, i don't think it adds that much extra complexity. I will attach an alternative patch which names the short option "-J", so that there is no need to drop the current "-I". See, it's really just about adding a third way to iterate, which is all isolated in a separate function, plus a few line to chdir($ROOT/VDB). Anyway, whether this option is needed or not is really a matter of taste. If you don't like it, well, then don't merge it, i promise won't mind too much :) > If the .ebuild.x thing you are viewing as a problem then I think we are better > off making a fallback there for all applets when no .ebuild.x exists. Like > stuffing one in memory or /dev/shm or ~/.ebuild.x or so. Don't have time to really think about it right now, but yes, that's probably something to keep in mind. Probably it's worth a line in the TODO.
Created attachment 114573 [details, diff] qgrep-add_--installed.patch
(In reply to comment #7) > Created an attachment (id=114573) [edit] > qgrep-add_--installed.patch /var/cvsroot/gentoo-projects/portage-utils/qgrep.c,v <-- qgrep.c new revision: 1.21; previous revision: 1.20
This is released in 0.1.25 Bug #168334 ; q -r dies with a segfault after emerge --sync Bug #168442 ; does not properly parse the profile location Bug #170795 ; add a -E/--eclass option to qgrep Bug #170797 ; add a -s/--skip-comments option to qgrep Bug #171024 ; opening '/usr/portage/.metadata.x' failed Bug #171374 ; Misc enhancements for qgrep Bug #172240 ; -A/-B options for qgrep (context lines) Bug #172338 ; qgrepping through installed ebuilds (in the VDB) Bug #173005 ; Colorized output for qgrep.
Closing