Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 183015 Details for
Bug 259318
app-portage/gentoolkit-0.2.4.2-r1: euse doesn't look in /etc/portage/package.use
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Better-still implementation of package.use inclusion in euse -i
euse.package.use.patch (text/plain), 3.64 KB, created by
Jared Hancock
on 2009-02-24 14:27:25 UTC
(
hide
)
Description:
Better-still implementation of package.use inclusion in euse -i
Filename:
MIME Type:
Creator:
Jared Hancock
Created:
2009-02-24 14:27:25 UTC
Size:
3.64 KB
patch
obsolete
>--- /usr/bin/euse 2009-02-06 08:35:58.893794000 -0600 >+++ euse 2009-02-24 08:23:18.667454001 -0600 >@@ -14,6 +14,7 @@ > MAKE_GLOBALS_PATH=/etc/make.globals > MAKE_PROFILE_PATH=/etc/make.profile > MAKE_CONF_BACKUP_PATH=/etc/make.conf.euse_backup >+PACKAGE_USE_PATH=/etc/portage/package.use > > [ -z "${MODE}" ] && MODE="showhelp" # available operation modes: showhelp, showversion, showdesc, showflags, modify > >@@ -148,9 +149,36 @@ > print ' '.join(r)" > } > >+# Similar to reduce_incrementals except converts lines from package atoms >+# in /etc/portage/package.use files to lines of "pkg [-]flag" >+reduce_package_use() { >+ echo "${@}" | python -c "import sys,re >+h={}; getflags=re.compile(r'(-?[\w-]+)') >+for x in sys.stdin.read().split('\n'): >+ if not x: continue >+ pkg,flags = x.lstrip().split(' ',1) >+ flags = getflags.findall(flags) >+ if not pkg in h: >+ h[pkg]=flags >+ else: >+ r=h[pkg] >+ for x in flags: >+ if x[0] == '-' and x[1:] in r: >+ r.remove[x] >+ r.append(x) >+ elif x[0] != '-' and '-'+x in r: >+ r.remove('-'+x) >+ r.append(x) >+ elif x == '-*': >+ r = h[pkg] = ['-*'] >+ elif x not in r: >+ r.append(x) >+print '\n'.join([' %s %s ' % (pkg,' '.join(flgs)) for pkg,flgs in h.iteritems()])" >+} >+ > # the following function creates a bash array ACTIVE_FLAGS that contains the > # global use flags, indexed by origin: 0: environment, 1: make.conf, >-# 2: make.defaults, 3: make.globals >+# 2: make.defaults, 3: make.globals, 4: package.use > get_useflags() { > # only calculate once as calling emerge is painfully slow > [ -n "${USE_FLAGS_CALCULATED}" ] && return >@@ -175,6 +203,15 @@ > USE="${ACTIVE_FLAGS[0]}" > PORTDIR="${portdir_backup}" > >+ # Parse through /etc/portage/package.use >+ if [[ -d ${PACKAGE_USE_PATH} ]]; then >+ ACTIVE_FLAGS[4]=$( find ${PACKAGE_USE_PATH} -type f | xargs cat ) >+ elif [[ -e ${PACKAGE_USE_PATH} ]]; then >+ ACTIVE_FLAGS[4]=$( cat ${PACKAGE_USE_PATH} ) >+ fi >+ # Simplify ACTIVE_FLAGS[4] to be lines of pkg [-]flag >+ ACTIVE_FLAGS[4]=$(reduce_package_use "${ACTIVE_FLAGS[4]}"); >+ > # get the currently active USE flags as seen by portage, this has to be after > # restoring USE or portage won't see the original environment > ACTIVE_FLAGS[9]="$(emerge --info | grep 'USE=' | cut -b 5- | sed -e 's:"::g')" #' >@@ -239,13 +276,16 @@ > # 3: echo value for positive (and as lowercase for negative) test result, > # 4 (optional): echo value for "missing" test result, defaults to blank > get_flagstatus_helper() { >- if echo " ${ACTIVE_FLAGS[${2}]} " | grep " ${1} " > /dev/null; then >+ if echo " ${ACTIVE_FLAGS[${2}]} " | grep " ${1} " | grep "${5} " > /dev/null; then > echo -n "${3}" >- elif echo " ${ACTIVE_FLAGS[${2}]} " | grep " -${1} " > /dev/null; then >+ return 0 >+ elif echo " ${ACTIVE_FLAGS[${2}]} " | grep " -${1} " | grep "${5} " > /dev/null; then > echo -n "$(echo ${3} | tr [[:upper:]] [[:lower:]])" >+ return 0 > else > echo -n "${4:- }" > fi >+ return 1 > } > > # prints a status string for the given flag, each column indicating the presence >@@ -256,7 +296,14 @@ > get_useflags > > echo -n '[' >- get_flagstatus_helper "${1}" 9 "+" "-" >+ if [ "${SCOPE}" == "local" ]; then >+ if ! get_flagstatus_helper "${1}" 4 "+" "-" "${2}" ; then >+ echo -n -e "\b" >+ get_flagstatus_helper "${1}" 9 "+" "-" >+ fi >+ else >+ get_flagstatus_helper "${1}" 9 "+" "-" >+ fi > get_flagstatus_helper "${1}" 0 "E" > get_flagstatus_helper "${1}" 1 "C" > get_flagstatus_helper "${1}" 2 "D" >@@ -328,7 +375,7 @@ > pkg="$(echo $line | cut -d\| -f 1)" > flag="$(echo $line | cut -d\| -f 2)" > desc="$(echo $line | cut -d\| -f 3)" >- get_flagstatus "${flag}" >+ get_flagstatus "${flag}" "${pkg}" > printf "%s (%s):\n%s\n\n" "${flag}" "${pkg}" "${desc}" > done > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 259318
:
182988
|
182989
|
183014
| 183015 |
183081
|
183439
|
183504
|
184367
|
190800
|
192995
|
193030
|
194335
|
200549
|
200725
|
200742
|
200775
|
201375
|
203986
|
204266
|
205351
|
206046
|
206051
|
206094
|
208863
|
212955
|
212957
|
213875
|
258232
|
258291
|
258556
|
258893
|
261774
|
262303
|
265751
|
265753
|
266759
|
267621