Add support for --rdeps-only and --root-deps options which are useful in
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:47:03 +0000 (06:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:47:03 +0000 (06:47 -0000)
combination with $ROOT. Thanks to Ned Ludd <solar@g.o> for the initial
patch. (trunk r13245)

svn path=/main/branches/2.1.6/; revision=13424

man/emerge.1
pym/_emerge/__init__.py
pym/_emerge/help.py

index a2420b8ad5dbc4335676c13c0084205aad3be4b0..bccb0ed35f7673d6ac234cfc6b57bade3abe28ac 100644 (file)
@@ -411,12 +411,26 @@ b blocked by another package (automatically resolved conflict)
 Results may vary, but the general outcome is a reduced or condensed
 output from portage's displays.
 .TP
+.BR "\-\-rdeps\-only"
+Discard all build\-time dependencies. This option is commonly used together
+with \fBROOT\fR and it should not be enabled under normal circumstances. For
+currently supported \fBEAPI\fR values, the dependencies specified in the
+\fBDEPEND\fR variable are discarded. However, behavior may change for new
+\fBEAPI\fRs when related extensions are added in the future.
+.TP
 .BR "\-\-reinstall changed\-use"
 Tells emerge to include installed packages where USE flags have
 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\-deps"
+Install build\-time dependencies to \fBROOT\fR instead of /. This option
+should not be enabled under normal circumstances. For currently supported
+\fBEAPI\fR values, the dependencies specified in the \fBDEPEND\fR variable
+are used. However, behavior may change for new
+\fBEAPI\fRs when related extensions are added in the future.
+.TP
 .BR "\-\-skipfirst"
 This option is only valid when used with \fB\-\-resume\fR.  It removes the 
 first package in the resume list. Dependencies are recalculated for
index 7cf0f7cbda1bf05de5ba155b22a7c31e992c2e8a..2fb51be78d2168669a0bc243f877987cef77c6dd 100644 (file)
@@ -207,6 +207,7 @@ options=[
 "--nospinner",    "--oneshot",
 "--onlydeps",     "--pretend",
 "--quiet",        "--resume",
+"--rdeps-only",   "--root-deps",
 "--searchdesc",   "--selective",
 "--skipfirst",
 "--tree",
@@ -5259,8 +5260,16 @@ class depgraph(object):
                if removal_action and self.myopts.get("--with-bdeps", "y") == "n":
                        edepend["DEPEND"] = ""
 
+               bdeps_root = "/"
+               if self.target_root != "/":
+                       if "--root-deps" in self.myopts:
+                                       bdeps_root = myroot
+                       if "--rdeps-only" in self.myopts:
+                                       bdeps_root = "/"
+                                       edepend["DEPEND"] = ""
+
                deps = (
-                       ("/", edepend["DEPEND"],
+                       (bdeps_root, edepend["DEPEND"],
                                self._priority(buildtime=(not bdeps_optional),
                                optional=bdeps_optional)),
                        (myroot, edepend["RDEPEND"], self._priority(runtime=True)),
index 200f307087f7fa7a25ab18814a1eadeb0428e0f6..89b3bf043c4d0ea243ef979970aa4acd36b877e1 100644 (file)
@@ -401,12 +401,30 @@ def help(myaction,myopts,havecolor=1):
                print "              Effects vary, but the general outcome is a reduced or condensed"
                print "              output from portage's displays."
                print
+               print "       "+green("--rdeps-only")
+               desc = "Discard all build-time dependencies. This option is commonly used together " + \
+                       "with ROOT and it should not be enabled under normal circumstances. For " + \
+                       "currently supported EAPI values, the dependencies specified in the " + \
+                       "DEPEND variable are discarded. However, behavior may change for new " + \
+                       "EAPIs when related extensions are added in the future."
+               for line in wrap(desc, desc_width):
+                       print desc_indent + line
+               print
                print "       "+green("--reinstall ") + turquoise("changed-use")
                print "              Tells emerge to include installed packages where USE flags have"
                print "              changed since installation.  Unlike --newuse, this option does"
                print "              not trigger reinstallation when flags that the user has not"
                print "              enabled are added or removed."
                print
+               print "       "+green("--root-deps")
+               desc = "Install build-time dependencies to ROOT instead of /. This option " + \
+                       "should not be enabled under normal circumstances. For currently supported " + \
+                       "EAPI values, the dependencies specified in the DEPEND variable " + \
+                       "are used. However, behavior may change for new " + \
+                       "EAPIs when related extensions are added in the future."
+               for line in wrap(desc, desc_width):
+                       print desc_indent + line
+               print
                print "       "+green("--skipfirst")
                desc = "This option is only valid when " + \
                        "used with --resume.  It removes the " + \