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 1Q1L1g-0001WY-Ge for garchives@archives.gentoo.org; Sun, 20 Mar 2011 15:58:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0EA9D1C01F; Sun, 20 Mar 2011 15:58:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D1D191C01F for ; Sun, 20 Mar 2011 15:58:36 +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 3B62B1B40FC for ; Sun, 20 Mar 2011 15:58:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4C9658006A for ; Sun, 20 Mar 2011 15:58:35 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <7ff280c89551def11cf9fa7e5a22c580553e0e6e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/main.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 7ff280c89551def11cf9fa7e5a22c580553e0e6e Date: Sun, 20 Mar 2011 15:58:35 +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: 3615a41dd8b0b497c482232a527675fc commit: 7ff280c89551def11cf9fa7e5a22c580553e0e6e Author: Zac Medico gentoo org> AuthorDate: Sun Mar 20 15:57:42 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Mar 20 15:57:42 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D7ff280c8 emerge_main: add "args" parameter (sys.argv[1:]) Also, fix local portage.debug import so that "global portage" is not necessary. --- pym/_emerge/main.py | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index f061ae4..1a63bc7 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1340,8 +1340,14 @@ def check_procfs(): level=3Dlogging.ERROR, noiselevel=3D-1) return 1 =20 -def emerge_main(): - global portage # NFC why this is necessary now - genone +def emerge_main(args=3DNone): + """ + @param args: command arguments (default: sys.argv[1:]) + @type args: list + """ + if args is None: + args =3D sys.argv[1:] + portage._disable_legacy_globals() portage.dep._internal_warnings =3D True # Disable color until we're sure that it should be enabled (after @@ -1351,7 +1357,7 @@ def emerge_main(): # possible, such as --config-root. They will be parsed again later, # together with EMERGE_DEFAULT_OPTS (which may vary depending on the # the value of --config-root). - myaction, myopts, myfiles =3D parse_opts(sys.argv[1:], silent=3DTrue) + myaction, myopts, myfiles =3D parse_opts(args, silent=3DTrue) if "--debug" in myopts: os.environ["PORTAGE_DEBUG"] =3D "1" if "--config-root" in myopts: @@ -1372,7 +1378,7 @@ def emerge_main(): tmpcmdline =3D [] if "--ignore-default-opts" not in myopts: tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split()) - tmpcmdline.extend(sys.argv[1:]) + tmpcmdline.extend(args) myaction, myopts, myfiles =3D parse_opts(tmpcmdline) =20 if myaction not in ('help', 'info', 'version') and \ @@ -1536,11 +1542,10 @@ def emerge_main(): =20 if settings.get("PORTAGE_DEBUG", "") =3D=3D "1": spinner.update =3D spinner.update_quiet - portage.debug=3D1 portage.util.noiselimit =3D 0 if "python-trace" in settings.features: - import portage.debug - portage.debug.set_trace(True) + import portage.debug as portage_debug + portage_debug.set_trace(True) =20 if not ("--quiet" in myopts): if '--nospinner' in myopts or \