From: Zac Medico Date: Thu, 30 Apr 2009 06:47:20 +0000 (-0000) Subject: Add a --root option that sets $ROOT (complements the --config-root option). X-Git-Tag: v2.1.6.12~148 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a2d94563a6659b9fb5f71989d0ea06c42820b1b7;p=portage.git Add a --root option that sets $ROOT (complements the --config-root option). (trunk r13246) svn path=/main/branches/2.1.6/; revision=13425 --- diff --git a/man/emerge.1 b/man/emerge.1 index bccb0ed35..c5aff973f 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -424,6 +424,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 @@ -485,7 +488,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 2fb51be78..75f3724c4 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -14445,7 +14445,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 @@ -14838,6 +14842,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)