summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-01 01:49:22 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-01 01:49:22 +0000
commit1cc9b5f31812a4963c16d6b7b4304dbf5958e9bd (patch)
tree20f0a8f57bc976094b10efb677eb958004c83964 /pym/_emerge/__init__.py
parent358a34b09b6f8213442564fbe087fa2a0f5d5a46 (diff)
downloadportage-1cc9b5f31812a4963c16d6b7b4304dbf5958e9bd.tar.gz
portage-1cc9b5f31812a4963c16d6b7b4304dbf5958e9bd.tar.bz2
portage-1cc9b5f31812a4963c16d6b7b4304dbf5958e9bd.zip
Combine the --rdeps-only and --root-deps options into a single --root-deps
option which takes an optional 'rdeps' argument. svn path=/main/trunk/; revision=13267
Diffstat (limited to 'pym/_emerge/__init__.py')
-rw-r--r--pym/_emerge/__init__.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 103689c80..63fc92262 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -207,7 +207,6 @@ options=[
"--nospinner", "--oneshot",
"--onlydeps", "--pretend",
"--quiet", "--resume",
-"--rdeps-only", "--root-deps",
"--searchdesc", "--selective",
"--skipfirst",
"--tree",
@@ -5277,9 +5276,11 @@ class depgraph(object):
bdeps_root = "/"
if self.target_root != "/":
- if "--root-deps" in self.myopts:
+ root_deps = self.myopts.get("--root-deps")
+ if root_deps is not None:
+ if root_deps is True:
bdeps_root = myroot
- if "--rdeps-only" in self.myopts:
+ elif root_deps == "rdeps":
bdeps_root = "/"
edepend["DEPEND"] = ""
@@ -14769,11 +14770,22 @@ def insert_optional_args(args):
new_args = []
jobs_opts = ("-j", "--jobs")
+ root_deps_opt = '--root-deps'
+ root_deps_choices = ('True', 'rdeps')
arg_stack = args[:]
arg_stack.reverse()
while arg_stack:
arg = arg_stack.pop()
+ if arg == root_deps_opt:
+ new_args.append(arg)
+ if arg_stack and arg_stack[-1] in root_deps_choices:
+ new_args.append(arg_stack.pop())
+ else:
+ # insert default argument
+ new_args.append('True')
+ continue
+
short_job_opt = bool("j" in arg and arg[:1] == "-" and arg[:2] != "--")
if not (short_job_opt or arg in jobs_opts):
new_args.append(arg)
@@ -14866,6 +14878,12 @@ def parse_opts(tmpcmdline, silent=False):
"help" : "specify the target root filesystem for merging packages",
"action" : "store"
},
+
+ "--root-deps": {
+ "help" : "modify interpretation of depedencies",
+ "type" : "choice",
+ "choices" :("True", "rdeps")
+ },
}
from optparse import OptionParser
@@ -14894,6 +14912,9 @@ def parse_opts(tmpcmdline, silent=False):
myoptions, myargs = parser.parse_args(args=tmpcmdline)
+ if myoptions.root_deps == "True":
+ myoptions.root_deps = True
+
if myoptions.jobs:
jobs = None
if myoptions.jobs == "True":