Bug #287869 - Add a --selective[=n] option (inverse of --oneshot). This is
authorZac Medico <zmedico@gentoo.org>
Fri, 16 Oct 2009 23:38:29 +0000 (23:38 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 16 Oct 2009 23:38:29 +0000 (23:38 -0000)
useful if you want to use EMERGE_DEFAULT_OPTS to make --oneshot behavior
default.

svn path=/main/trunk/; revision=14615

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

index fc0a880ebb08e72af5c4b8dbe56be663c6993714..c516755f3c3d19cd60f49ca9c61a0b760195a551 100644 (file)
@@ -476,6 +476,12 @@ be enabled under normal circumstances. For currently supported
 \fBDEPEND\fR variable. However, behavior may change for new
 \fBEAPI\fRs when related extensions are added in the future.
 .TP
+.BR "\-\-select"[=n]
+Add specified packages to the world set (inverse of
+\fB\-\-oneshot\fR). This is useful if you want to
+use \fBEMERGE_DEFAULT_OPTS\fR to make
+\fB\-\-oneshot\fR behavior default.
+.TP
 .BR "\-\-selective"[=n]
 This is similar to the \fB\-\-noreplace\fR option, except that it
 does not take precedence over options such as \fB\-\-newuse\fR.
index 50145dad5c9b4c22af2df1ce5257e9ef6951c894..bbeb2fb365dffe584a950984e51b245de0adba02 100644 (file)
@@ -502,6 +502,14 @@ def help(myopts, havecolor=1):
                for line in wrap(desc, desc_width):
                        print(desc_indent + line)
                print()
+               print("       " + green("--select") + "[=%s]" % turquoise("n"))
+               desc = "Add specified packages to the world set (inverse of " + \
+                       "--oneshot). This is useful if you want to " + \
+                       "use EMERGE_DEFAULT_OPTS to make " + \
+                       "--oneshot behavior default."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
+               print()
                print("       " + green("--selective") + "[=%s]" % turquoise("n"))
                desc = "This is similar to the --noreplace option, except that it " + \
                        "does not take precedence over options such as --newuse. " + \
index 3e445b2e8c43d62e17d62c4079ad0cd8b185f2b4..ac63419c7293b3fc85ee0283d96265dbca8a88ac 100644 (file)
@@ -389,6 +389,7 @@ def insert_optional_args(args):
                '--jobs'       : valid_integers,
                '--keep-going'           : ('n',),
                '--root-deps'  : ('rdeps',),
+               '--select'               : ('n',),
                '--selective'            : ('n',),
                '--usepkg'               : ('n',),
                '--usepkgonly'           : ('n',),
@@ -613,6 +614,13 @@ def parse_opts(tmpcmdline, silent=False):
                        "choices" :("True", "rdeps")
                },
 
+               "--select": {
+                       "help"    : "add specified packages to the world set " + \
+                                   "(inverse of --oneshot)",
+                       "type"    : "choice",
+                       "choices" : ("True", "n")
+               },
+
                "--selective": {
                        "help"    : "similar to the --noreplace but does not take " + \
                                    "precedence over options such as --newuse",
@@ -704,6 +712,11 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.root_deps == "True":
                myoptions.root_deps = True
 
+       if myoptions.select == "True":
+               myoptions.oneshot = False
+       elif myoptions.select == "n":
+               myoptions.oneshot = True
+
        if myoptions.selective == "True":
                myoptions.selective = True