I want to query a installed package, and it must have specified use flag:
e.g. eix -I curl:use flag
Currently I am using grep
to filter the output. I want to know if it is possible to do it in one command line.
If you want to use eix
, you can use its --installed-with-use
option:
$ eix --installed-with-use ipv6 curl
You may omit the last argument to enumerate all of the query results for any installed package with a particular useflag:
$ eix --installed-with-use ipv6
If you need to check if a particular package is installed with a particular useflag and can use eix
, then you could do:
#!/bin/sh
if ! eix -q --installed-with-use ipv6 net-misc/curl; then
echo "Our distribution server only has an IPv6 address. Please reinstall net-misc/curl with USE=ipv6." >&2
exit 1
fi
You can use the q
utility like following:
q use +flag
Or it's alias quse
:
quse +flag
To do this you need to have the portage-utils
package installed.
quse
does not help me filter the packages that are currently installed. so, i am going with @binki 's answer. thanks :) – David S. Jan 01 '14 at 04:28eix --installed-with-use
so thanks for that – replay Jan 01 '14 at 06:39