From 5b658d893053a5c46531b0d49b3e7b27a0e70ce1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 21 Nov 2008 22:32:10 +0000 Subject: [PATCH] Bug #248059 - Make --depclean more tolerant of invalid atoms in dependencies of packages that will be uninstalled anyway. (trunk r12020) svn path=/main/branches/2.1.6/; revision=12021 --- pym/_emerge/__init__.py | 9 ++++----- pym/portage/__init__.py | 12 ++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 8762d68d9..ff4e279ca 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -12428,11 +12428,10 @@ def action_depclean(settings, trees, ldpath_mtimes, finally: portage.dep._dep_check_strict = True if not success: - show_invalid_depstring_notice( - ("installed", myroot, node, "nomerge"), - depstr, atoms) - return - + # Ignore invalid deps of packages that will + # be uninstalled anyway. + continue + priority = priority_map[dep_type] for atom in atoms: if not isinstance(atom, portage.dep.Atom): diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 6c369efbb..b6f5cf8be 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -6601,8 +6601,16 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, writemsg("mysplit: %s\n" % (mysplit), 1) writemsg("mysplit2: %s\n" % (mysplit2), 1) - myzaps = dep_zapdeps(mysplit, mysplit2, myroot, - use_binaries=use_binaries, trees=trees) + try: + myzaps = dep_zapdeps(mysplit, mysplit2, myroot, + use_binaries=use_binaries, trees=trees) + except portage.exception.InvalidAtom, e: + if portage.dep._dep_check_strict: + raise # This shouldn't happen. + # dbapi.match() failed due to an invalid atom in + # the dependencies of an installed package. + return [0, "Invalid atom: '%s'" % (e,)] + mylist = flatten(myzaps) writemsg("myzaps: %s\n" % (myzaps), 1) writemsg("mylist: %s\n" % (mylist), 1) -- 2.26.2