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 1S6x5L-0002jN-EY for garchives@archives.gentoo.org; Mon, 12 Mar 2012 04:42:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF28DE0A4F; Mon, 12 Mar 2012 04:42:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8B072E0985 for ; Mon, 12 Mar 2012 04:42:04 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2F101B4016 for ; Mon, 12 Mar 2012 04:42:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id BC5F7E5402 for ; Mon, 12 Mar 2012 04:42:01 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1331494902.6e4f1bd23cbb3332fa1d4f1e570420b743e01296.vapier@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/, pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: bin/isolated-functions.sh bin/portageq pym/portage/output.py pym/portage/package/ebuild/doebuild.py X-VCS-Directories: pym/portage/package/ebuild/ bin/ pym/portage/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 6e4f1bd23cbb3332fa1d4f1e570420b743e01296 X-VCS-Branch: master Date: Mon, 12 Mar 2012 04:42:01 +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: 913cbd1e-843e-4135-8c76-7a4c468d4fd8 X-Archives-Hash: 0a9e9ff090b9d57f3e5e9054b63ff9ca commit: 6e4f1bd23cbb3332fa1d4f1e570420b743e01296 Author: Mike Frysinger gentoo org> AuthorDate: Sun Mar 11 04:15:31 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Mar 11 19:41:42 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D6e4f1bd2 portageq: add "colormap" helper Signed-off-by: Mike Frysinger gentoo.org> --- bin/isolated-functions.sh | 2 +- bin/portageq | 8 ++++++++ pym/portage/output.py | 6 ++++++ pym/portage/package/ebuild/doebuild.py | 8 ++------ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 9321ad5..98be41e 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -431,8 +431,8 @@ set_colors() { BAD=3D$'\e[31;01m' HILITE=3D$'\e[36;01m' BRACKET=3D$'\e[34;01m' + NORMAL=3D$'\e[0m' fi - NORMAL=3D$'\e[0m' } =20 RC_ENDCOL=3D"yes" diff --git a/bin/portageq b/bin/portageq index 5ecbb21..fcdb9d9 100755 --- a/bin/portageq +++ b/bin/portageq @@ -44,6 +44,7 @@ del pym_path from portage import os from portage.eapi import eapi_has_repo_deps from portage.util import writemsg, writemsg_stdout +from portage.output import colormap portage.proxy.lazyimport.lazyimport(globals(), 'subprocess', '_emerge.Package:Package', @@ -685,6 +686,13 @@ def distdir(argv): print(portage.settings["DISTDIR"]) =20 =20 +def colormap(argv): + """ + Display the color.map as environment variables. + """ + print(portage.output.colormap()) + + def envvar(argv): """+ Returns a specific environment variable as exists prior to ebuild.sh. diff --git a/pym/portage/output.py b/pym/portage/output.py index 43d7503..98bec81 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -325,6 +325,12 @@ def style_to_ansi_code(style): ret +=3D codes.get(attr_name, attr_name) return ret =20 +def colormap(): + mycolors =3D [] + for c in ("GOOD", "WARN", "BAD", "HILITE", "BRACKET", "NORMAL"): + mycolors.append("%s=3D$'%s'" % (c, style_to_ansi_code(c))) + return "\n".join(mycolors) + def colorize(color_key, text): global havecolor if havecolor: diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package= /ebuild/doebuild.py index c45aa03..4ff3eea 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -50,7 +50,7 @@ from portage.exception import DigestException, FileNotF= ound, \ IncorrectParameter, InvalidDependString, PermissionDenied, \ UnsupportedAPIException from portage.localization import _ -from portage.output import style_to_ansi_code +from portage.output import colormap from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs from portage.util import apply_recursive_permissions, \ apply_secpass_permissions, noiselimit, normalize_path, \ @@ -300,11 +300,7 @@ def doebuild_environment(myebuild, mydo, myroot=3DNo= ne, settings=3DNone, mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_DIR) =20 # Allow color.map to control colors associated with einfo, ewarn, etc..= . - mycolors =3D [] - for c in ("GOOD", "WARN", "BAD", "HILITE", "BRACKET"): - mycolors.append("%s=3D$'%s'" % \ - (c, style_to_ansi_code(c))) - mysettings["PORTAGE_COLORMAP"] =3D "\n".join(mycolors) + mysettings["PORTAGE_COLORMAP"] =3D colormap() =20 if "COLUMNS" not in mysettings: # Set COLUMNS, in order to prevent unnecessary stty calls