Bug #248059 - Make --depclean more tolerant of invalid atoms in dependencies
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Nov 2008 22:32:10 +0000 (22:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Nov 2008 22:32:10 +0000 (22:32 -0000)
of packages that will be uninstalled anyway. (trunk r12020)

svn path=/main/branches/2.1.6/; revision=12021

pym/_emerge/__init__.py
pym/portage/__init__.py

index 8762d68d9767458255eba578f3ba2178ff23880c..ff4e279ca80455569196c8a3f9e8b72c56bca711 100644 (file)
@@ -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):
index 6c369efbb247ebe222ee2c8ae86eae4b98b9e401..b6f5cf8beef52209447a6c7ec0008d2242dde153 100644 (file)
@@ -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)