Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script to verify USE flags are actually used?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nutznboltz
Apprentice
Apprentice


Joined: 23 Apr 2004
Posts: 239

PostPosted: Thu Feb 02, 2006 2:28 pm    Post subject: Script to verify USE flags are actually used? Reply with quote

I am looking for a script to help clean up deprecated USE flags from /etc/make.conf. I tried searching in /usr/portage/use.desc on each one but I think that file is out-of-date. What I want is something to track down the ebuilds my system is using and find if there are USE= flags in /etc/make.conf that do not appear in any IUSE= in the any of the ebuilds and output them so I can remove them from the USE=

Thanks! :)
Back to top
View user's profile Send private message
Teetante
Guru
Guru


Joined: 02 Mar 2004
Posts: 515
Location: Oldenburg/Germany

PostPosted: Thu Feb 02, 2006 2:44 pm    Post subject: Reply with quote

I think ufed (app-portage/ufed) should do the trick.
It reads the useflags from your make.conf and writes your new choice into the file so I suppose it should omit all non-existant useflags.
_________________
ICQ #81510866 - http://the-gay-bar.com - MSN tante@emptiness.de
Occam's Razor:
-"Entia non sunt multiplicanda praeter necessitatem."-
Back to top
View user's profile Send private message
nutznboltz
Apprentice
Apprentice


Joined: 23 Apr 2004
Posts: 239

PostPosted: Thu Feb 02, 2006 4:48 pm    Post subject: Reply with quote

Thanks. But I like my stuff more simple than that so I've started my own script:

Two scripts. "real-USE-helper"

Code:
#! /bin/bash

# extract IUSE

# deal with ebuild stuff we hate

case `arch` in
x86_64)
   ARCH=amd64
;;
i?86)
   ARCH=x86
;;
esac

# run
# ./real-USE 2>&1 | awk -F: '/not found/ { print $3 }' | sort -u
# Then use emacs to turn them into stubroutines

addpredict() {
:
}
addwrite() {
:
}
append-flags() {
:
}
bzipped() {
:
}
core_package() {
:
}
delete_all_version_separators() {
:
}
delete_version_separator() {
:
}
deprange() {
:
}
deprange-dual() {
:
}
detect_arch() {
:
}
detect_version() {
:
}
egnustep_install_domain() {
:
}
filter-flags() {
:
}
filter-mfpmath() {
:
}
get-child-packages() {
:
}
get_libdir() {
:
}
get_libname() {
:
}
get_major_version() {
:
}
get_version_component_range() {
echo 1
}
goodies() {
:
}
goodies_plugin() {
:
}
has_multilib_profile() {
:
}
has_version() {
:
}
inherit() {
:
}
is-flag() {
:
}
need-kde() {
:
}
need-qt() {
:
}
need_apache() {
:
}
need_apache1() {
:
}
need_apache2() {
:
}
need_php() {
:
}
need_php4() {
:
}
need_php_by_category() {
:
}
newdepend() {
:
}
plugin() {
:
}
python_version() {
:
}
qt_min_version() {
:
}
replace-flags() {
:
}
replace_all_version_separators() {
:
}
replace_version_separator() {
:
}
set-kdedir() {
:
}
set-qtdir() {
:
}
sgml-catalog_cat_include() {
:
}
single_make() {
:
}
strip-flags() {
:
}
tc-getCC() {
:
}
use() {
:
}
use_enable() {
:
}
use_with() {
:
}
useq() {
:
}
version_is_at_least() {
:
}
want_apache() {
:
}

. $1
echo $IUSE

and real-USE
Code:
#! /bin/sh

find /usr/portage -name '*.ebuild' -print | xargs -n 1 real-USE-helper | grep -v '^ *$' | tr " " "\012" | sort -u


./real-USE > /tmp/real-USE

Then compare that to your USE= in /etc/make.conf

Right now I see
Code:
16bit 16bittmp 3dfx 3dnow 3dnowext 3ds 64bit 7zip GAPING_SECURITY_HOLE S3TC X X509 Xaw3d a52 aac aalib abook accessibility acl acpi activefilter ada adns adsl afs aim aimextras aio aliaschain allegro alsa altivec amarok amd amr amrr amuled ansi anthy ao aotuv apache apache1 apache2 apm applet aqua aqua_theme araneida ares arts artswrappersuid artworkextra aserve asf asm asterisk async athena atk atlas atm auctex audacious audiofile auth authdaemond authfile automount avahi avalon avantgo avi ax25 badval bahamut bash-completion bashlogger batch bcp bdf beep berkdb bgpclassless bidi big-tables bigger-fonts bigpatch bind-mysql bindist binfilter bitmap-fonts bittorrent bjam bl blas bluetooth bmp bmpx bonjour bonobo boo bookmarks bootsplash bootstrap bri brltty browserplugin buffysize build bundled-libs buttons bzip2 c++ c3p0 cacheemu cairo canna cap capi caps carbone_theme cardbus ccache cdb cdda cddb cdf cdinstall cdio cdparanoia cdr cdrom cegui cg cgi chasen checkpath chipcard chm chroot cjk ck-server clamav clamd clanJavaScript clanVoice cle266 clearcase clearpasswd cli client-only clisp cln clock-screen cluster cmkopt cmucl cnamefix cobalt command-args commercial config_wizard corba coreaudio courier cpudetection cpulimit cracklib crosscompile crypt css csv cups curl custom-cflags customlog custreloc cvs cvsgraph cxx cyrus daap dar32 dar64 datadir dbcp dbi dbm dbox2 dbus dbx debug debugger dedicated delays devfs26 devil devmap dga dhcp dict diet dillo directfb disablexmb discard-path disk-cache diskio distribution djbfft dlloader dlopen dlz dmalloc dmx dnd dnsdb doc double-precision dpms drac dri dsml dssi dtaus dts dv dvb dvd dvdr dvdread dvi dxr3 dynagraph dynamic eap-tls eb ecaggressive ecc eckb1 ecmark ecmark2 ecmark3 ecmg2 ecsteve ecsteve2 edirectory editor edl eds effects elf emacs emacs-w3 emboss emerald emoticon emul-linux-x86 encode enscript epiphany epson erandom escreen esd estraier esx ethereal etwin eurofile ev6 evo evolution examples exif exim exiscan exiscan-acl expat ext-iiimf ext-png ext-zlib extensions extraengine extraicons extramodules extras fakelog fam fame fast fastcgi fat fax faxonly fbcon fbdev fbsplash fep festival ffcall ffmpeg fftw figlet finger firebird firefox fits fix-connected-rt flac flash flexresp flood floppyboot floppyd florz fltk fluidsynth fmod follow-xff font-server fontconfig foomaticdb force-cgi-redirect fortran fping fpx frascend freetds freetext freetts freewnn frnothreads frontendonly frxp ftp ftruncate fuse fusion fwdzone gatos gcc-libffi gcj gcl gd gdal gdb gdbm gecko-sdk geldkarte gencertdaily general geoip geometry geos gg ggi gif gimp gimpprint ginac gitsendemail gkrellm glade glep glgd glibc-compat20 glibc-omitfp glitz glut gmail gml gmp gmtfull gmthigh gmtsuppl gmttria gnokii gnome gnome-print gnomecanvas gnomedb gnuplot gnustep gnutls gopher gpgme gphoto2 gpm gprof gps grammar graphicsmagick graphviz gs gsl gsm gsnd gssapi gstreamer gtalk gtk gtk2 gtkhtml gtkspell guile guionly gvim gzip h323 hal hardened haskell hbci hdaps hddtemp hdf hdf5 hesiod hfs high-ints hlapi hou howl howl-compat hpn html http httpd hub i8x0 ibam ibm ical icc icecast icon iconv icp icq icu id3 ide idea idl idled idn ieee1394 ifc ignore-glep31 iksemel ilbc image imagemagick imap imlib imlib2 immqt immqt-bc inetd inkjar inline innkeywords innodb inntaggedhash inode insecure-drivers insecure-patches insecure-savers intl ip27 ip28 ip30 ipalias ipod ipppd iproute2 ipv6 irc irda irixpasswd irmc irssi isdn isdnlog itcl ithreads j2ee jabber jack jack-tmpfs jad jai java javacomm javamail javascript jbig jboss jce jcs jfs jikes jimi jit jms jmx john joystick jp2 jpeg jpeg2k jpty jta jumpplay junit justify jython kakasi kaspersky kcal kde kdeenablefinal kdepim kdgraphics kerberos kexi key-screen keyscrub kig-scripting kipi kjs kqemu krb4 ladcca ladspa lame lapack large-domain largenet largeterminal latex layout-from-conf-file layout-osx-like lcd lcms ldap ldapsam ldb ldirectord leim lesstif libabcl libcaca libclamav libdsk libedit libg++ libgda libsamplerate libtommath libvisual libwww lids lighttpd lingerd linuxkeys linuxthreads-tls lirc lite live livecd lj lm_sensors lmtp lnbsharing log4j login-watch logitech-mouse logmail logrotate logwatch lowmem ltsp lua lynxkeymap lzo lzw m17n-lib mad madwifi mail mailbox maildir maildrop mailwrapper make-symlinks mapeditor maps math matroska matrox max-idx-128 maya-shaderlibrary mbox mbrola mbx mccp md5sum mdb mdnsresponder-compat mecab mem-cache memcache menubar messages mew mgetty mhash migemo mikmod milter mime mimencode minimal mips16 mixer mjpeg mmap mmx mmxext mng mod mod_irc mod_lisp mod_muc mod_pubsub mod_python mode-force mode-owner mode-paranoid modelock modperl modplug module moneyplex mono monolithic mopac7 motif mounts-check mouse mozcalendar mozdevelop mozilla moznocompose moznoirc moznomail mozsha1 mozsvg mozxmlterm mp3 mp4live mpe mpeg mpeg2 mpi mpi_njtree mplayer mpm-leader mpm-peruser mpm-prefork mpm-threadpool mpm-worker mppe-mppc mpqc mschap msdav mslu msn msnextras mssql muine mule multi-tty multicall multidata multilib multipath multipleip multiprocess multislot mupad-noscilab musepack music musicbrainz mysql mysqlfriends mythtv n32 n64 nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh nas nautilus ncurses neXt net netboot netcdf netclient nethack netpbm netserver network neural new-login nextaw nforce2 nfs nis njb nls nntp no-helpbrowser no-helper no-htdocs no-net2 no-opts no-readseq no-suexec no-utils no24bpp no_wxgtk1 noamazon noantlr noaudio noauthcram noauthunix nobackchannel nobcel nobeanutils nobsf nobsh nocd nocman nocommonslogging nocommonsnet nocxx nodoc nodrm nodroproot noexercises noexperimental noflagstrip nogg nojava nojdepend nojoystick nojsch nojython nokia6600 nolog4j nologin nolvmstatic nomalloccheck nomotif nomusic non-flattened nonfsv4 nooro noplugin nopop3d noqmax norealanalysis noregexp norewrite norhino normalizemime nosamples nosendmail nosound nosource nosrc nothemes nothreadsafe notlsbeforeauth nousb nousuid novideo noweb nowebdav nowin noxalan noxerces noxft nptl nptlonly nsplugin nspr ntfs ntlm ntlm_unsupported_patch numarray numeric nvidia nvram oav objc ocaml oci8 oci8-instant-client octave odbc ode offensive ofx ogdi ogg oggvorbis ogre old-crypt old-eq oldworld on-the-fly-crypt onoe openal openbabel openexr opengl openntpd openssh openssl opera oracle orathreads ortp osc oscache oscar ospfapi oss pager pam pam-mysql pam_chroot pam_console pam_timestamp pango parse-clocks pascal passfile password passwordsave patch patented pbbuttonsd pbs pcapnav pccts pci pcmcia pcre pcsc-lite pda pdf pear-db perforce perl perlsuid pg-hier pg-intdatetime pg-vacuumdelay pheaders php physfs pic pike planner player plib plotutils plugin plx pmu png pop pop3d portaudio postfix postgres povray ppcsha1 ppds pppd pregen prelude preview-latex pri print priority procmail profile proj proxool pvm pwdb pxeserial pymol pyste python pyx qdbm qemu-fast qhull qmail qt quicktime quotas quotes radiotap radius rar raw-mode rc5 rcu rdesktop readline real realms recursor reiser4 reiserfs remix remote resperl rhino rhythmbox rle rogue roundrobin rpc rplay rpm rrdtool rsbac rsh rss rtc ruby samba sametime sample sasl savedconfig sbcl sblive scanner scp screen script sdk sdl search search-screen selinux semanticfix sendfile sendmail sensord serial server servlet-2.3 servlet-2.4 session setup-plugin sftp sftplogging sguil shape shaper shared sharedmem sheep shorten shout sid silc silvercity silverxp skey skins skk slang slp smartcard smarty smime smp sms smtp smux sndfile snmp snortsam socks5 softfax softmmu softquota sou sounds soundtouch source sourcecaps sox spamassassin speech speedo speex spell spf spreadsheet sql sqlite sqlite3 srp srs srv sse sse-filters sse2 ssl standalone startup-notification static static-modules static_pairalign staticsocket stats stencil-buffer stlport stream streamzap stroke struts subject-rewrite subp subtitles subversion suid suidcheck svg svga svgz svn-mirror swarmcache swat sylpheed sysfs syslog szip t1lib tabs tagwriting talkfilters tcc tcltk tcp tcp-zebra tcpd tcpmd5 tcsim tdb test tetex text tga theora thesaurus threads threadsonly thumbnail tidy tiff timidity tlen tomsfastmath toolbar tools tos tpctlir transcode translator transparent-proxy truetype truetype-fonts trusted type1 type1-fonts uclibc uclibc-compat ucs2 ucs4 udev udpfromto uim ukcid ultra1 uml underscores unichrome unicode unsafe unsupported_8bit ups urandom usb user-homedirs userfiles userlocales utf8 uudeview v4l v4l2 vanilla vcd vcdimager vchroot vda verbose vfat vhosts videos vidix vim virtual virtual-users virus-scan vis visualization vlm vmdbmysql vmdbpostgres vnc voice voodoo3 vorbis vpopmail watchdog web webdav webmin-minimal webservices wifi win32codecs winbind withsamplescripts wma wma123 wmf wordexp wordperfect wv wxgtk1 wxwindows x11vnc x264 xanim xatrix xattr xbase xchat xchatdccserver xchatnogtk xchattext xcomposite xemacs xerces-c xext xface xforms xfs xgetdefault xim xine xinerama xinetd xlockrc xmail xml xml2 xmldoclet xmms xosd xpm xprint xrandr xscreensaver xsl xslt xtended xv xvid xvmc yaepg yahoo yaz yiff yp yv12 zapnet zapras zaptel zero-penalty-hit zeroconf zlib zvbi
Back to top
View user's profile Send private message
nutznboltz
Apprentice
Apprentice


Joined: 23 Apr 2004
Posts: 239

PostPosted: Thu Feb 02, 2006 4:56 pm    Post subject: Reply with quote

one more script "dead-USE"

Code:
#! /bin/bash

MYFILE=/tmp/bingo

real-USE > $MYFILE

. /etc/make.conf

for i in $USE
do
  i=`echo $i |sed 's/^-//'`
  grep -sq $i $MYFILE
  if [ $? = 1 ]; then
      echo $i
  fi
done
Back to top
View user's profile Send private message
rawfuzz
n00b
n00b


Joined: 02 Oct 2006
Posts: 13
Location: USA

PostPosted: Wed Oct 04, 2006 1:51 pm    Post subject: Re: Script to verify USE flags are actually used? Reply with quote

nutznboltz wrote:
What I want is something to track down the ebuilds my system is using and find if there are USE= flags in /etc/make.conf that do not appear in any IUSE= in the any of the ebuilds and output them so I can remove them from the USE=

Thanks! :)

doesn't equery do that?

Quote:
hasuse h -- list all packages with specified useflag
uses u -- display USE flags for package


You can use euse to +FLAG -FLAG and PRUNE flags from your make.conf.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum