6

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.

2 Answers 2

9

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
2

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.

2
  • 2
    unfortunately, quse does not help me filter the packages that are currently installed. so, i am going with @binki 's answer. thanks :)
    – David S.
    Jan 1, 2014 at 4:28
  • You're right, his answer is better. I also didn't know eix --installed-with-use so thanks for that
    – replay
    Jan 1, 2014 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .