Add support for --selective=n, so it can be used to remove selective
behavior that may have been implied by some other option like --update.

svn path=/main/trunk/; revision=14120
diff --git a/man/emerge.1 b/man/emerge.1
index 47d1efa..1781988 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -446,9 +446,12 @@
 \fBDEPEND\fR variable. However, behavior may change for new
 \fBEAPI\fRs when related extensions are added in the future.
 .TP
-.BR "\-\-selective"
+.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.
+Some options, such as \fB\-\-update\fR, imply \fB\-\-selective\fR.
+Use \fB\-\-selective=n\fR if you want to forcefully disable
+\fB\-\-selective\fR, regardless of options like \fB\-\-update\fR.
 .TP
 .BR "\-\-skipfirst"
 This option is only valid when used with \fB\-\-resume\fR.  It removes the 
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 9381fb9..188dc6f 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -2,6 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
+import logging
+from portage.util import writemsg_level
+
 def create_depgraph_params(myopts, myaction):
 	#configure emerge engine parameters
 	#
@@ -23,7 +26,7 @@
 		"--newuse" in myopts or \
 		"--reinstall" in myopts or \
 		"--noreplace" in myopts or \
-		"--selective" in myopts:
+		myopts.get("--selective", "n") != "n":
 		myparams["selective"] = True
 	if "--emptytree" in myopts:
 		myparams["empty"] = True
@@ -34,5 +37,15 @@
 		myparams["deep"] = myopts["--deep"]
 	if "--complete-graph" in myopts:
 		myparams["complete"] = True
+	if myopts.get("--selective") == "n":
+		# --selective=n can be used to remove selective
+		# behavior that may have been implied by some
+		# other option like --update.
+		myparams.pop("selective", None)
+
+	if '--debug' in myopts:
+		writemsg_level('\n\nmyparams %s\n\n' % myparams,
+			noiselevel=-1, level=logging.DEBUG)
+
 	return myparams
 
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 448ef1a..cbd1fe4 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -467,9 +467,12 @@
 		for line in wrap(desc, desc_width):
 			print desc_indent + line
 		print
-		print "       " + green("--selective")
+		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."
+			"does not take precedence over options such as --newuse. " + \
+			"Some options, such as --update, imply --selective. " + \
+			"Use --selective=n if you want to forcefully disable " + \
+			"--selective, regardless of options like --update."
 		for line in wrap(desc, desc_width):
 			print desc_indent + line
 		print
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 8e9a8a2..c5a16ff 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -52,7 +52,7 @@
 "--nospinner",    "--oneshot",
 "--onlydeps",     "--pretend",
 "--quiet",        "--resume",
-"--searchdesc",   "--selective",
+"--searchdesc",
 "--skipfirst",
 "--tree",
 "--update",
@@ -377,6 +377,7 @@
 		'--getbinpkgonly'        : ('n',),
 		'--jobs'       : valid_integers,
 		'--root-deps'  : ('rdeps',),
+		'--selective'            : ('n',),
 		'--usepkg'               : ('n',),
 		'--usepkgonly'           : ('n',),
 	}
@@ -584,6 +585,13 @@
 			"choices" :("True", "rdeps")
 		},
 
+		"--selective": {
+			"help"    : "similar to the --noreplace but does not take " + \
+			            "precedence over options such as --newuse",
+			"type"    : "choice",
+			"choices" : ("True", "n")
+		},
+
 		"--usepkg": {
 			"shortopt" : "-k",
 			"help"     : "use binary packages",
@@ -656,6 +664,9 @@
 	if myoptions.root_deps == "True":
 		myoptions.root_deps = True
 
+	if myoptions.selective == "True":
+		myoptions.selective = True
+
 	if myoptions.deep is not None:
 		deep = None
 		if myoptions.deep == "True":