From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QDng3-0003FB-DT for garchives@archives.gentoo.org; Sun, 24 Apr 2011 00:59:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 15752E045E; Sun, 24 Apr 2011 00:59:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C0791E045E for ; Sun, 24 Apr 2011 00:59:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0E27E1B4013 for ; Sun, 24 Apr 2011 00:59:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3F0AB803E3 for ; Sun, 24 Apr 2011 00:59:45 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <38d480d4eea1d2db421d4fa9ed9af2a32bbebe37.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: bin/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: bin/euse X-VCS-Directories: bin/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 38d480d4eea1d2db421d4fa9ed9af2a32bbebe37 Date: Sun, 24 Apr 2011 00:59:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f6549b43dadb0c1f866da665b94e8030 commit: 38d480d4eea1d2db421d4fa9ed9af2a32bbebe37 Author: Brian Dolbec gmail com> AuthorDate: Sun Apr 24 00:59:32 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Apr 24 00:59:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D38d480d4 fix python-3 compatibility for euse bug 364081 --- bin/euse | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/euse b/bin/euse index 8262271..5590fbb 100755 --- a/bin/euse +++ b/bin/euse @@ -185,7 +185,7 @@ VER # worth another look to avoid calling python unnecessariy. Or we c= ould # 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=3D[] for x in sys.stdin.read().split(): if x[0] =3D=3D '-' and x[1:] in r: @@ -196,14 +196,14 @@ for x in sys.stdin.read().split(): r.append(x) elif x =3D=3D '-*': r =3D ['-*'] elif x not in r: r.append(x) -print ' '.join(r)"=20 +print(' '.join(r))"=20 } # }}} =20 # 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=3D[] for x in sys.stdin.read().split(): if x[0] =3D=3D '-' and x[1:] in r: @@ -211,7 +211,7 @@ for x in sys.stdin.read().split(): r.append(x) elif x =3D=3D '-*': r =3D ['-*'] elif x not in r and not '-'+x in r: r.append(x) -print ' '.join(r)"=20 +print(' '.join(r))"=20 } # }}} =20 # 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 s= ys,re h=3D{}; getflags=3Dre.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 =3D=3D '-*': r =3D h[pkg] =3D ['-*'] elif x not in r: r.append(x) -print '\n'.join(['%s %s' % (pkg,' '.join(flgs)) for pkg,flgs in h.iterit= ems() if len(flgs)])" +print('\n'.join(['%s %s' % (pkg,' '.join(flgs)) for pkg,flgs in h.items(= ) if len(flgs)]))" } # }}} =20 # Function: get_useflags {{{ @@ -511,8 +511,8 @@ get_flagstatus_helper_pkg() { if [[ -z "${atoms[@]/[<>=3D]*/}" ]]; then atoms=3D($( 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=3D$(for atom in ${atoms[@]}; do [[ -z $atom ]] && continue