portage.dep.isvalidatom(): Add support for atoms with wildcards
authorSebastian Luther <SebastianLuther@gmx.de>
Fri, 23 Jul 2010 13:43:40 +0000 (15:43 +0200)
committerZac Medico <zmedico@gentoo.org>
Fri, 23 Jul 2010 16:47:13 +0000 (09:47 -0700)
pym/portage/dep/__init__.py

index bd5cfcc86a283525c1673cf52146722bfe97222a..c58a83e4489b3fa5b91bb672053cb9a3b2af8d8f 100644 (file)
@@ -938,7 +938,7 @@ _atom_re = re.compile('^(?P<without_use>(?:' +
        '(?P<simple>' + _cp + '))(:' + _slot + ')?)(' + _use + ')?$', re.VERBOSE)
 _atom_wildcard_re = re.compile('(?P<simple>((' + _cat + '|\*)/(' + _pkg + '|\*)))$')
 
-def isvalidatom(atom, allow_blockers=False):
+def isvalidatom(atom, allow_blockers=False, allow_wildcard=False):
        """
        Check to see if a depend atom is valid
 
@@ -957,7 +957,7 @@ def isvalidatom(atom, allow_blockers=False):
        """
        try:
                if not isinstance(atom, Atom):
-                       atom = Atom(atom)
+                       atom = Atom(atom, allow_wildcard=allow_wildcard)
                if not allow_blockers and atom.blocker:
                        return False
                return True