Bug #233252 - Handle InvalidAtom exceptions that can be raised from
authorZac Medico <zmedico@gentoo.org>
Fri, 1 Aug 2008 07:05:00 +0000 (07:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 1 Aug 2008 07:05:00 +0000 (07:05 -0000)
depgraph._add_dep() calls inside _add_pkg_deps().

svn path=/main/trunk/; revision=11309

pym/_emerge/__init__.py

index f002aa3186054403161be437b12582649b589108..a401e7e0997b36ad1c0a6874a3fb525337c0bbae 100644 (file)
@@ -4624,25 +4624,30 @@ class depgraph(object):
                                        return 0
                                if debug:
                                        print "Candidates:", selected_atoms
+
                                for atom in selected_atoms:
-                                       if isinstance(atom, basestring) \
-                                               and not portage.isvalidatom(atom):
+                                       try:
+
+                                               blocker = atom.startswith("!")
+                                               if blocker:
+                                                       atom = atom[1:]
+                                               mypriority = dep_priority.copy()
+                                               if not blocker and vardb.match(atom):
+                                                       mypriority.satisfied = True
+
+                                               if not self._add_dep(Dependency(atom=atom,
+                                                       blocker=blocker, depth=depth, parent=pkg,
+                                                       priority=mypriority, root=dep_root),
+                                                       allow_unsatisfied=allow_unsatisfied):
+                                                       return 0
+
+                                       except portage.exception.InvalidAtom, e:
                                                show_invalid_depstring_notice(
-                                                       pkg, dep_string, str(atom))
+                                                       pkg, dep_string, str(e))
+                                               del e
                                                if not pkg.installed:
                                                        return 0
-                                               continue
-                                       blocker = atom.startswith("!")
-                                       if blocker:
-                                               atom = atom[1:]
-                                       mypriority = dep_priority.copy()
-                                       if not blocker and vardb.match(atom):
-                                               mypriority.satisfied = True
-                                       if not self._add_dep(Dependency(atom=atom,
-                                               blocker=blocker, depth=depth, parent=pkg,
-                                               priority=mypriority, root=dep_root),
-                                               allow_unsatisfied=allow_unsatisfied):
-                                               return 0
+
                                if debug:
                                        print "Exiting...", jbigkey
                except ValueError, e: