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

bin/repoman

index 9f48a1536f9310990c5cbdd7e322b91e118a62a5..4749523dd9a51595f011078016511fa8a475e912 100755 (executable)
@@ -1702,14 +1702,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 \