Summary: | app-portage/pfl - e-file: use portageq instead of emerge --info | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jeroen Roovers (RETIRED) <jer> |
Component: | Current packages | Assignee: | Daniel Pielmeier <billie> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | bugs, martin |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | e-file-portageq.patch |
Description
Jeroen Roovers (RETIRED)
![]() Created attachment 314571 [details, diff]
e-file-portageq.patch
Just a few notes: 1. "portageq portdir" exists 2. "type" is not POSIX. Better replace it by "command -v" 3. "eix --print PORTDIR" is much quicker than portageq (of course, this can only be used if "command -v eix >/dev/null 2>%1" returns 0) (In reply to comment #2) > Just a few notes: > 1. "portageq portdir" exists Correct! > 3. "eix --print PORTDIR" is much quicker than portageq (of course, this can > only be used if "command -v eix >/dev/null 2>%1" returns 0) elmer ~ # time eix --print PORTDIR /world/gentoo/portage/ real 0m0.633s user 0m0.050s sys 0m0.100s elmer ~ # time echo $( . /etc/make.globals 2>/dev/null; . /etc/make.conf 2>/dev/null; echo ${PORTDIR:-/usr/portage} ) /world/gentoo/portage real 0m0.047s user 0m0.020s sys 0m0.000s (In reply to comment #3) > elmer ~ # time eix --print PORTDIR > elmer ~ # time echo $( . /etc/make.globals 2>/dev/null; . /etc/make.conf I am not sure what you want to say here: I was comparing the speed of eix with the speed of portageq. Of course, shell-sourcing is even faster, but it is not reliable here: For instance, certain escapes are handled differentiy, and if your shell is /bin/dash even a "source" command will bail out. I don't think it makes much sense arguing about such tiny details. In the long run it is planned to replace e-file with a python implementation (see bug #413191). This way it can use the portage api which I think renders this discussion useless. Just do a: import portage PORTDIR = portage.portdb.porttree_root or something like this and be done. PS: Martin why did you change the status to RESOLVED FIXED? I did not intend to change the status: It was shown in my browser as "resolved fixed", and I didn't touch it. (Perhaps this was a problem of noscript blocking some code...) +*pfl-2.4 (06 Oct 2013) + + 06 Oct 2013; Daniel Pielmeier <billie@gentoo.org> +pfl-2.4.ebuild, + +files/e-file-20110906-portageq.patch: + Version bump. Fixes bug #420111, thanks to Jeroen Roovers for the patch. + Fixed bug #481296, thanks to Alice Ferrazzi for the report and Daniel for the + fix. For now I have committed the patch with the portageq approach. Maybe there will be a python version of e-file some time but until then this should do. |