parser.add_option('-I', '--ignore-masked', dest='ignore_masked', action='store_true',
default=False, help='ignore masked packages (not allowed with commit mode)')
+ parser.add_option('-d', '--include-dev', dest='include_dev', action='store_true',
+ default=False, help='include dev profiles in dependency checks')
+
parser.add_option('--without-mask', dest='without_mask', action='store_true',
default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)')
for prof in profiles[arch]:
- if prof[1] not in ("stable", "dev"):
+ if prof[1] not in ("stable", "dev") or \
+ prof[1] == "dev" and not options.include_dev:
continue
profdir = portdir+"/profiles/"+prof[0]
self._show_merge_list()
msg = []
- msg.append("\n!!! Multiple versions within a single " + \
+ msg.append("\n!!! Multiple package instances within a single " + \
"package slot have been pulled\n")
msg.append("!!! into the dependency graph, resulting" + \
" in a slot conflict:\n\n")
priority=priority)
return 1
else:
+
+ if pkg.cpv == existing_node.cpv and \
+ dep.atom is not None and \
+ dep.atom.use:
+ # Multiple different instances of the same version
+ # (typically one installed and another not yet
+ # installed) have been pulled into the graph due
+ # to a USE dependency. The "slot collision" display
+ # is not helpful in a case like this, so display it
+ # as an unsatisfied dependency.
+ self._unsatisfied_deps_for_display.append(
+ ((dep.root, dep.atom), {"myparent":dep.parent}))
+ self._slot_collision_info.add((pkg.slot_atom, pkg.root))
+ self._slot_collision_nodes.add(pkg)
+ self.digraph.addnode(pkg, myparent, priority=priority)
+ return 0
+
if pkg in self._slot_collision_nodes:
return 1
# A slot collision has occurred. Sometimes this coincides
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.
+
+ All output goes to stderr, except for unsatisfied dependencies which
+ go to stdout for parsing by programs such as autounmask.
"""
+ # Note that show_masked_packages() sends it's output to
+ # stdout, and some programs such as autounmask parse the
+ # output in cases when emerge bails out. However, when
+ # show_masked_packages() is called for installed packages
+ # here, the message is a warning that is more appropriate
+ # to send to stderr, so temporarily redirect stdout to
+ # stderr. TODO: Fix output code so there's a cleaner way
+ # to redirect everything to stderr.
+ sys.stdout.flush()
+ sys.stderr.flush()
+ stdout = sys.stdout
+ try:
+ sys.stdout = sys.stderr
+ self._display_problems()
+ finally:
+ sys.stdout = stdout
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ # This goes to stdout for parsing by programs like autounmask.
+ for pargs, kwargs in self._unsatisfied_deps_for_display:
+ self._show_unsatisfied_dep(*pargs, **kwargs)
+
+ def _display_problems(self):
if self._circular_deps_for_display is not None:
self._show_circular_deps(
self._circular_deps_for_display)
show_mask_docs()
print
- 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):
return []
if max_load is not None and \
(max_jobs is True or max_jobs > 1) and \
- self._running_job_count() > 1:
+ self._running_job_count() >= 1:
try:
avg1, avg5, avg15 = os.getloadavg()
except OSError, e:
for consumer_dblink in set(chain(*consumers.values())):
consumer_pkg = vardb.get(("installed", myroot,
consumer_dblink.mycpv, "nomerge"))
- resolver._add_pkg(pkg, Dependency(parent=consumer_pkg,
+ if not resolver._add_pkg(pkg,
+ Dependency(parent=consumer_pkg,
priority=UnmergeDepPriority(runtime=True),
- root=pkg.root))
+ root=pkg.root)):
+ resolver.display_problems()
+ return 1
writemsg_level("\nCalculating dependencies ")
success = resolver._complete_graph()
unread_filename = self._unread_filename(repoid)
unread_lock = lockfile(unread_filename, wantnewlockfile=1)
try:
- unread = set(grabfile(unread_filename))
- unread_orig = unread.copy()
- skip = set(grabfile(skip_filename))
- skip_orig = skip.copy()
+ try:
+ unread = set(grabfile(unread_filename))
+ unread_orig = unread.copy()
+ skip = set(grabfile(skip_filename))
+ skip_orig = skip.copy()
+ except PermissionDenied:
+ return
updates = []
for itemid in news:
except (InvalidLocation, OperationNotPermitted, PermissionDenied):
return 0
try:
- return len(grabfile(unread_filename))
+ try:
+ return len(grabfile(unread_filename))
+ except PermissionDenied:
+ return 0
finally:
if unread_lock:
unlockfile(unread_lock)