From: Zac Medico Date: Tue, 2 Mar 2010 20:38:54 +0000 (-0000) Subject: Use isvalidatom to validate PROVIDE entries. (trunk r15397) X-Git-Tag: v2.1.8~103 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fd5d4b07fe849c469591f45ac7ad6d8372094a4f;p=portage.git Use isvalidatom to validate PROVIDE entries. (trunk r15397) svn path=/main/branches/2.1.7/; revision=15619 --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 4ecc1052e..97be8ccf2 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -7,7 +7,7 @@ import sys from itertools import chain import portage from portage.cache.mappings import slot_dict_class -from portage.dep import paren_reduce, use_reduce, \ +from portage.dep import isvalidatom, paren_reduce, use_reduce, \ paren_normalize, paren_enclose, _slot_re from _emerge.Task import Task @@ -289,9 +289,15 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase): getattr(self, "_set_" + k.lower())(k, v) elif k in self._use_conditional_keys: try: - use_reduce(paren_reduce(v), matchall=1) + reduced = use_reduce(paren_reduce(v), matchall=1) except portage.exception.InvalidDependString as e: self._pkg._invalid_metadata(k + ".syntax", "%s: %s" % (k, e)) + else: + if reduced and k == 'PROVIDE': + for x in portage.flatten(reduced): + if not isvalidatom(x): + self._pkg._invalid_metadata(k + ".syntax", + "%s: %s" % (k, x)) def _set_inherited(self, k, v): if isinstance(v, basestring):