Create Atom instances earlier to avoid redundant validation.
authorZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 00:03:45 +0000 (00:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 00:03:45 +0000 (00:03 -0000)
svn path=/main/trunk/; revision=10495

bin/repoman

index 5ed5c0b620ac9477fe6d0b128293a088eab0c920..7f381da942923c683e493cb72db904dbd95271af 100755 (executable)
@@ -1251,14 +1251,15 @@ for x in scanlist:
                                        if token in operator_tokens or \
                                                token.endswith("?"):
                                                continue
-                                       if not portage.isvalidatom(token, allow_blockers=True):
+                                       try:
+                                               atom = portage.dep.Atom(token)
+                                       except portage.exception.InvalidAtom:
                                                badsyntax.append("'%s' not a valid atom" % token)
                                        else:
-                                               atom = token
-                                               is_blocker = atom.startswith("!")
-                                               if is_blocker:
-                                                       atom = token.lstrip("!")
-                                               atom = portage.dep.Atom(atom)
+                                               is_blocker = atom.blocker
+                                               if atom.blocker:
+                                                       atom = portage.dep.Atom(atom[1:])
+
                                                if mytype == "DEPEND" and \
                                                        not is_blocker and \
                                                        not inherited_java_eclass and \