diff options
author | Brian Dolbec <brian.dolbec@gmail.com> | 2011-04-23 17:59:32 -0700 |
---|---|---|
committer | Brian Dolbec <brian.dolbec@gmail.com> | 2011-04-23 17:59:32 -0700 |
commit | 38d480d4eea1d2db421d4fa9ed9af2a32bbebe37 (patch) | |
tree | d6090470342f96c47a5a91aa350a81957bbda620 /bin | |
parent | Change eprefix.py to only look at portage for the value of EPREFIX (diff) | |
download | gentoolkit-38d480d4eea1d2db421d4fa9ed9af2a32bbebe37.tar.gz gentoolkit-38d480d4eea1d2db421d4fa9ed9af2a32bbebe37.tar.bz2 gentoolkit-38d480d4eea1d2db421d4fa9ed9af2a32bbebe37.zip |
fix python-3 compatibility for euse bug 364081gentoolkit-0.3.0.1
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/euse | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -185,7 +185,7 @@ VER # worth another look to avoid calling python unnecessariy. Or we could # just write the whole thing in python. ;) reduce_incrementals() { - echo $@ | python -c "import sys + echo $@ | python -c "from __future__ import print_function;import sys r=[] for x in sys.stdin.read().split(): if x[0] == '-' and x[1:] in r: @@ -196,14 +196,14 @@ for x in sys.stdin.read().split(): r.append(x) elif x == '-*': r = ['-*'] elif x not in r: r.append(x) -print ' '.join(r)" +print(' '.join(r))" } # }}} # Function: reduce_incrementals_trump {{{ # Similar to reduce_incrementals but negative flags trump positive # flags, regardless of which follows which reduce_incrementals_trump() { - echo $@ | python -c "import sys + echo $@ | python -c "from __future__ import print_function;import sys r=[] for x in sys.stdin.read().split(): if x[0] == '-' and x[1:] in r: @@ -211,7 +211,7 @@ for x in sys.stdin.read().split(): r.append(x) elif x == '-*': r = ['-*'] elif x not in r and not '-'+x in r: r.append(x) -print ' '.join(r)" +print(' '.join(r))" } # }}} # Function: reduce_package_use {{{ @@ -222,7 +222,7 @@ print ' '.join(r)" # * - Lines of package atom followed by flags # (app-editors/vim flag1 flag2 -flag3) reduce_package_use() { - echo "${@}" | python -c "import sys,re + echo "${@}" | python -c "from __future__ import print_function;import sys,re h={}; getflags=re.compile(r'(-?[\w*-]+)') for x in sys.stdin.read().split('\n'): if not x: continue @@ -242,7 +242,7 @@ for x in sys.stdin.read().split('\n'): 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() if len(flgs)])" +print('\n'.join(['%s %s' % (pkg,' '.join(flgs)) for pkg,flgs in h.items() if len(flgs)]))" } # }}} # Function: get_useflags {{{ @@ -511,8 +511,8 @@ get_flagstatus_helper_pkg() { if [[ -z "${atoms[@]/[<>=]*/}" ]]; then atoms=($( echo "${atoms[@]}" | python -c " -import portage.dep as dep, sys -print ' '.join(dep.match_to_list('$5-$6',sys.stdin.read().split()))")) +from __future__ import print_function;import portage.dep as dep, sys +print(' '.join(dep.match_to_list('$5-$6',sys.stdin.read().split()))")) fi flags=$(for atom in ${atoms[@]}; do [[ -z $atom ]] && continue |