From 1c818a0918f7162e803477055e9de2b87d23327f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 29 Mar 2009 19:26:50 +0000 Subject: Add a --root option that sets $ROOT (complements the --config-root option). svn path=/main/trunk/; revision=13246 --- man/emerge.1 | 6 +++++- pym/_emerge/__init__.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index 60e15338f..7a82a91bd 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -427,6 +427,9 @@ changed since installation. Unlike \fB\-\-newuse\fR, this option does not trigger reinstallation when flags that the user has not enabled are added or removed. .TP +.BR \-\-root=DIR +Set the \fBROOT\fR environment variable. +.TP .BR "\-\-root\-deps" Install build\-time dependencies to \fBROOT\fR instead of /. This option should not be enabled under normal circumstances. For currently supported @@ -488,7 +491,8 @@ command line. .TP \fBROOT\fR = \fI[path]\fR Use \fBROOT\fR to specify the target root filesystem to be used for -merging packages or ebuilds. This variable can be set in \fBmake.conf\fR(5). +merging packages or ebuilds. This variable can be set via the \fB\-\-root\fR +option or in \fBmake.conf\fR(5) (the command line overrides other settings). .br Defaults to /. .TP diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 773ef029c..0a0ab3414 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -14800,7 +14800,11 @@ def parse_opts(tmpcmdline, silent=False): "help":"specify conditions to trigger package reinstallation", "type":"choice", "choices":["changed-use"] - } + }, + "--root": { + "help" : "specify the target root filesystem for merging packages", + "action" : "store" + }, } from optparse import OptionParser @@ -15325,6 +15329,8 @@ def emerge_main(): os.environ["PORTAGE_DEBUG"] = "1" if "--config-root" in myopts: os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"] + if "--root" in myopts: + os.environ["ROOT"] = myopts["--root"] # Portage needs to ensure a sane umask for the files it creates. os.umask(022) -- cgit v1.2.3-1-g7c22