# 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"
def main(argv):
usage = "%s [options] <location> <old> <new>" % (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),))
-# 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
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"])