From 6c0d165a602f7394b19b26059fd6b11a7a661e80 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 2 Aug 2013 17:35:15 -0700 Subject: [PATCH] chpathtool.py: portage.util._argparse --- bin/chpathtool.py | 7 ++++--- pym/_emerge/Binpkg.py | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) 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"]) -- 2.26.2