From: Zac Medico Date: Sat, 3 Aug 2013 00:35:15 +0000 (-0700) Subject: chpathtool.py: portage.util._argparse X-Git-Tag: v2.2.0_alpha192~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c0d165a602f7394b19b26059fd6b11a7a661e80;p=portage.git chpathtool.py: portage.util._argparse --- diff --git a/bin/chpathtool.py b/bin/chpathtool.py index a040babfb..c35acd145 100755 --- a/bin/chpathtool.py +++ b/bin/chpathtool.py @@ -3,11 +3,12 @@ # Distributed under the terms of the GNU General Public License v2 import io -import optparse import os import stat import sys +from portage.util._argparse import ArgumentParser + CONTENT_ENCODING = "utf_8" FS_ENCODING = "utf_8" @@ -142,8 +143,8 @@ def chpath_inplace_symlink(filename, st, old, new): def main(argv): usage = "%s [options] " % (os.path.basename(argv[0],)) - parser = optparse.OptionParser(usage=usage) - options, args = parser.parse_args(argv[1:]) + parser = ArgumentParser(usage=usage) + options, args = parser.parse_known_args(argv[1:]) if len(args) != 3: parser.error("3 args required, got %s" % (len(args),)) diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py index ea8a1ad13..36f851609 100644 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@ -1,4 +1,4 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.EbuildPhase import EbuildPhase @@ -328,11 +328,13 @@ class Binpkg(CompositeTask): self.wait() return + env = self.settings.environ() + env["PYTHONPATH"] = self.settings["PORTAGE_PYTHONPATH"] chpathtool = SpawnProcess( args=[portage._python_interpreter, os.path.join(self.settings["PORTAGE_BIN_PATH"], "chpathtool.py"), self.settings["D"], self._build_prefix, self.settings["EPREFIX"]], - background=self.background, env=self.settings.environ(), + background=self.background, env=env, scheduler=self.scheduler, logfile=self.settings.get('PORTAGE_LOG_FILE')) self._writemsg_level(">>> Adjusting Prefix to %s\n" % self.settings["EPREFIX"])