Opello (from #gentoo-laptop) wrote a bash script called use-flags.sh that when run allows you to find out what packages have been emerged with a specific use flag. Reproducible: Always Steps to Reproduce:
Where can the script be found?
Created attachment 42341 [details] the use-flags.sh bash script Sorry, when I first submitted, it sent mail to my old email address. Had to wait for someone to post an update or comment before I could find it.
took me a while to work out that it lists installed packages that have the specified flag available... you may want to specify that it lists packages that have the specified flag as an option, as opposed to were emerged with it enabled... btw; i re-wrote it a fair bit, using bash's primitive string manipulation rather than sed/grep and its >300% faster - here's my end result :- ~ $ time ./use-flags2.new.sh xvid ; time ./use-flags2.sh xvid media-tv/xawdecode-1.9.1 media-video/avifile-0.7.41.20041001-r2 media-video/ffmpeg-0.4.9_p20050226-r1 media-video/transcode-0.6.14 real 0m0.926s user 0m0.521s sys 0m0.310s media-tv/xawdecode-1.9.1 media-video/avifile-0.7.41.20041001-r2 media-video/ffmpeg-0.4.9_p20050226-r1 media-video/transcode-0.6.14 real 0m4.959s user 0m1.653s sys 0m2.699s the above times are consistent no matter how often i run the test. and the script itself :- #!/bin/bash if [ -z "$1" ] || [ -n "$2" ]; then echo "Usage: $0 flag" exit fi for pkg in `find /var/db/pkg -type f -name '*.ebuild' -print | sort` do pdir=${pkg%/?*} if [ -f "$pdir/IUSE" ]; then FC=" $(< $pdir/IUSE) " [ -z "${FC/* $1 *}" ] && echo ${pdir#/*/*/*/} fi done
Created attachment 53905 [details] here's a script that I wrote myself to easily manipulate the system-wide USE flags in /etc/make.conf ~ # adduseflags USAGE: adduseflags <flags> flags: one or more use flags, separated by spaces, optionally prepended with a "-", "+" or "_" if a use flag isn't in the list, it will be added, be it +flag or -flag. if a use flag is in the list, and its state isn't changed, no change happens. if a use flag is in the list, and its state is changed (either from +flag to -flag or vice versa), the original flag is replaced by the new one this should make the use intuitive, whereby adduseflag option will "set" a flag, and adduseflags -flag will "unset" it. to remove a flag from the list altogether, restoring its effective state to default, prepend it with a "_", as in adduseflags _ipv6
(In reply to comment #3) # equery hasuse apache2 [ Searching for USE flag apache2 in all categories among: ] * installed packages [I--] [ ] dev-lang/php-4.4.1-r3 (4) [I--] [ ] app-admin/apachetop-0.12.5-r1 (0) [I--] [ ] www-apache/mod_jk-1.2.13 (0) [I--] [ ] net-www/mod_auth_mysql-3.0.0 (0) [I--] [ ] net-www/mod_log_sql-1.100 (0) [I--] [ ] net-www/apache-2.0.55-r1 (2) (In reply to comment #4) euse --enable, euse --disable Closing.