First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 172338
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: portage-utils <portage-utils@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: TGL <tom.gl@free.fr>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
qgrep-add_--installed_and_drop_--invert-match.patch qgrep-add_--installed_and_drop_--invert-match.patch patch TGL 2007-03-26 20:28 0000 5.80 KB Details | Diff
qgrep-add_--installed_and_drop_--invert-match.patch qgrep-add_--installed_and_drop_--invert-match.patch patch TGL 2007-03-26 21:45 0000 6.09 KB Details | Diff
qgrep-add_--installed.patch qgrep-add_--installed.patch patch TGL 2007-03-27 07:06 0000 5.28 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 172338 depends on: Show dependency tree
Show dependency graph
Bug 172338 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-03-26 20:24 0000
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.

------- Comment #1 From TGL 2007-03-26 20:28:57 0000 -------
Created an attachment (id=114543) [edit]
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.

------- Comment #2 From solar 2007-03-26 21:12:24 0000 -------
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

------- Comment #3 From TGL 2007-03-26 21:42:50 0000 -------
(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.

------- Comment #4 From TGL 2007-03-26 21:45:51 0000 -------
Created an attachment (id=114556) [edit]
qgrep-add_--installed_and_drop_--invert-match.patch

Rediffed for rev. 1.20

------- Comment #5 From solar 2007-03-26 23:17:02 0000 -------
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.

------- Comment #6 From TGL 2007-03-27 07:06:25 0000 -------
(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.

------- Comment #7 From TGL 2007-03-27 07:06:48 0000 -------
Created an attachment (id=114573) [edit]
qgrep-add_--installed.patch

------- Comment #8 From solar 2007-04-03 18:20:17 0000 -------
(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

------- Comment #9 From solar 2007-04-05 18:42:21 0000 -------
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.

------- Comment #10 From solar 2007-04-05 18:43:06 0000 -------
Closing

First Last Prev Next    No search results available      Search page      Enter new bug