Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 304705 - app-portage/eix (tiny enhancement request)
Summary: app-portage/eix (tiny enhancement request)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-12 09:40 UTC by Helmut Jarausch
Modified: 2010-02-16 18:29 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2010-02-12 09:40:49 UTC
It would be nice if

eix -I -q  CAT/PACK

returned a non-zero return-code if CAT/PACK is not installed.
(Currently it returns 0 irrespectively if CAT/PACK is installed or not.)

I'd like to use that in a shell for loop like

for P in .......; do

  if (eix -I -q $P); then .....; fi
done


Reproducible: Always
Comment 1 Martin Väth 2010-02-12 19:21:39 UTC
In eix' current svn trunk (>=eix-0.20.1) there are now eix-configuration
variables NOFOUND_STATUS, MOREFOUND_STATUS which determine the exit status
if 0 resp. 2 or more matches are found according to COUNT_ONLY_PRINTED.
Comment 2 Martin Väth 2010-02-14 10:59:35 UTC
I should perhaps note that you could of course easily get the
same effect with earlier eix versions with

if test -n "`eix -I --only-names $P`"; then ....; fi

but the disadvantage is clearly the speed, especially in case of many matches.
I added now also an option --brief (-0) which will cause eix to stop after
the first match (and thus also ends eix much earlier if combined with
COUNT_ONLY_PRINTED=false).
Summarizing: With >=eix-0.20.1 you can use

if test -n "`COUNT_ONLY_PRINTED=false eix -I0 --only-names $P`"; then ...; fi

or, even faster, combine both

if COUNT_ONLY_PRINTED=false NOFOUND_STATUS=1 eix -Iq0 $P; then ...; fi

(NOFOUND_STATUS=1 is the default, so this can also be omitted if you are
sure that it is not changed in the environment or eixrc files).
Comment 3 Helmut Jarausch 2010-02-15 10:28:57 UTC
Many thanks, Martin.
When does it appear in the tree?


Comment 4 Martin Väth 2010-02-16 18:29:25 UTC
eix-0.20.1 is now in the tree. Closing the bug.