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
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.
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).
Many thanks, Martin. When does it appear in the tree?
eix-0.20.1 is now in the tree. Closing the bug.