Difference between revisions of "Script gentoo use flags"

From Alessandro's Wiki
(Created page with 'Use flags are words representing parts of software that can be compiled with or without those pieces == script ''uses'' == it's a tiny dirty bash script very useful to know ...')
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Use flags are words representing parts of software that can be compiled with or without those pieces
In [[Gentoo]] Linux portage, USE flags are words representing parts of software that can be compiled with or without those "pieces"
 
 


== script ''uses'' ==
== script ''uses'' ==
Line 11: Line 9:
<pre>
<pre>
#!/bin/bash
#!/bin/bash
# by porcelinux82
# by porcelinux
source /etc/make.conf
source /etc/make.conf
USEfiles="/usr/portage/profiles/use.desc /usr/portage/profiles/use.local.desc"
USEfiles="/usr/portage/profiles/use.desc /usr/portage/profiles/use.local.desc"

Latest revision as of 16:46, 14 April 2011

In Gentoo Linux portage, USE flags are words representing parts of software that can be compiled with or without those "pieces"

script uses

it's a tiny dirty bash script very useful to know the meaning of a use flag (and check his existance) from terminal


#!/bin/bash
# by porcelinux
source /etc/make.conf
USEfiles="/usr/portage/profiles/use.desc /usr/portage/profiles/use.local.desc"
if ! [ "x$1" == "x" ]
then
        USES="$1"
else
        USES=$USE
fi

# to store the cleaned uses 
 newuses=""
for thisusefile in $USEfiles
do
echo "according: `basename $thisusefile` 
..."
        for thisuse in $USES
        do
                desc=""
                ABSflag=`echo $thisuse|sed -e s/-//`
                # echo ">> Use Flag [ $a ] " 
                if ( `grep -q ^$ABSflag $thisusefile` )
                then
                        [ "$ABSflag" == "$thisuse"  ] || desc="NOT> "
                        desc="$desc "`grep "^$ABSflag" $thisusefile`
                        newuses="$newuses $thisuse"
                else
                        desc="!$ABSflag --> Use flag NOT FOUND !"
                fi
                echo $desc

        done
echo "newuses:  $newuses"
done