self._pprovided_args = []
self._missing_args = []
self._masked_installed = []
+ self._unsatisfied_deps_for_display = []
def _show_slot_collision_notice(self):
"""Show an informational message advising the user to mask one of the
already been selected) will be required in order to handle all possible
cases."""
+ if not self._slot_collision_info:
+ return
+
msg = []
msg.append("\n!!! Multiple versions within a single " + \
"package slot have been \n")
self._missing_args.append(arg)
if "selective" not in self.myparams:
- self._show_unsatisfied_dep(
- myroot, arg, myparent=myparent)
+ self._unsatisfied_deps_for_display.append(
+ ((myroot, arg), {"myparent":myparent}))
return 0
pkg = Package(type_name=mytype, root=myroot,
if not matched_packages:
if raise_on_missing:
raise portage_exception.PackageNotFound(x)
- self._show_unsatisfied_dep(myroot, x,
- myparent=myparent)
+ self._unsatisfied_deps_for_display.append(
+ ((myroot, x), {"myparent":myparent}))
return 0
if "--debug" in self.myopts:
# unresolvable blocks.
for x in self.altlist():
if x[0] == "blocks":
+ self._slot_collision_info.clear()
return True
- self._show_slot_collision_notice()
if not self._accept_collisions():
return False
return True
print bold('*'+revision)
sys.stdout.write(text)
+ self.display_problems()
+ return os.EX_OK
+
+ def display_problems(self):
+ """
+ Display problems with the dependency graph such as slot collisions.
+ This is called internally by display() to show the problems _after_
+ the merge list where it is most likely to be seen, but if display()
+ is not going to be called then this method should be called explicitly
+ to ensure that the user is notified of problems with the graph.
+ """
+
+ self._show_slot_collision_notice()
+
if self._pprovided_args:
arg_refs = {}
for arg_atom in self._pprovided_args:
msg.append("The best course of action depends on the reason that an offending\n")
msg.append("package.provided entry exists.\n\n")
sys.stderr.write("".join(msg))
- return os.EX_OK
+
+ for pargs, kwargs in self._unsatisfied_deps_for_display:
+ self._show_unsatisfied_dep(*pargs, **kwargs)
def calc_changelog(self,ebuildpath,current,next):
if ebuildpath == None or not os.path.exists(ebuildpath):
merge_count = 0
pretend = "--pretend" in myopts
fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
+ ask = "--ask" in myopts
+ tree = "--tree" in myopts
+ verbose = "--verbose" in myopts
+ quiet = "--quiet" in myopts
if pretend or fetchonly:
# make the mtimedb readonly
mtimedb.filename = None
mydepgraph = depgraph(settings, trees, myopts, myparams, spinner)
if not mydepgraph.xcreate(myaction):
print "!!! Depgraph creation failed."
+ mydepgraph.display_problems()
return 1
if "--quiet" not in myopts and "--nodeps" not in myopts:
print "\b\b... done!"
portage.writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
return 1
if not retval:
+ mydepgraph.display_problems()
return 1
if "--quiet" not in myopts and "--nodeps" not in myopts:
print "\b\b... done!"
+ display = pretend or \
+ ((ask or tree or verbose) and not (quiet and not ask))
+ if not display:
+ mydepgraph.display_problems()
if "--pretend" not in myopts and \
("--ask" in myopts or "--tree" in myopts or \