summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/depgraph.py2
-rw-r--r--pym/_emerge/help.py7
-rw-r--r--pym/_emerge/main.py24
3 files changed, 32 insertions, 1 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5c0aa4b6..7f74b309 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5329,7 +5329,7 @@ def backtrack_depgraph(settings, trees, myopts, myparams,
def _backtrack_depgraph(settings, trees, myopts, myparams,
myaction, myfiles, spinner):
- backtrack_max = 30
+ backtrack_max = myopts.get('backtrack', 5)
runtime_pkg_mask = None
allow_backtracking = True
backtracked = 0
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 94dc1721..422442fb 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -279,6 +279,13 @@ def help(myopts, havecolor=1):
for line in wrap(desc, desc_width):
print(desc_indent + line)
print()
+ print(" " + green("--backtrack") + " " + turquoise("COUNT"))
+ desc = "Specifies an integer number of times to backtrack if " + \
+ "dependency calculation fails due to a conflict or an " + \
+ "unsatisfied dependency (default: '5')."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" " + green("--binpkg-respect-use") + \
" < " + turquoise("y") + " | " + turquoise("n") + " >")
desc = "Tells emerge to ignore binary packages if their use flags" + \
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 71872112..8e69ad05 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -510,6 +510,15 @@ def parse_opts(tmpcmdline, silent=False):
"help":"temporarily override ACCEPT_PROPERTIES",
"action":"store"
},
+
+ "--backtrack": {
+
+ "help" : "Specifies how many times to backtrack if dependency " + \
+ "calculation fails ",
+
+ "action" : "store"
+ },
+
"--config-root": {
"help":"specify the location for portage configuration files",
"action":"store"
@@ -731,6 +740,21 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.selective == "True":
myoptions.selective = True
+ if myoptions.backtrack is not None:
+
+ try:
+ backtrack = int(myoptions.backtrack)
+ except (OverflowError, ValueError):
+ backtrack = -1
+
+ if backtrack < 0:
+ backtrack = None
+ if not silent:
+ writemsg("!!! Invalid --backtrack parameter: '%s'\n" % \
+ (myoptions.backtrack,), noiselevel=-1)
+
+ myoptions.backtrack = backtrack
+
if myoptions.deep is not None:
deep = None
if myoptions.deep == "True":