"""
pn = d.getVar('PN', True)
licenses = d.getVar('LICENSE', True)
- from oe.license import license_operator
- from oe.license import license_pattern
+ from oe.license import license_operator, license_operator_chars, license_pattern
elements = filter(lambda x: x.strip(), license_operator.split(licenses))
for pos, element in enumerate(elements):
if license_pattern.match(element):
if pos > 0 and license_pattern.match(elements[pos - 1]):
- bb.warn("Recipe %s, LICENSE (%s) has invalid format, " \
- "LICENSES must have operator \"%s\" between them." %
- (pn, licenses, license_operator.pattern))
+ bb.warn('%s: LICENSE value "%s" has an invalid format - license names ' \
+ 'must be separated by the following characters to indicate ' \
+ 'the license selection: %s' %
+ (pn, licenses, license_operator_chars))
elif not license_operator.match(element):
- bb.warn("Recipe %s, LICENSE (%s) has invalid operator (%s) not in" \
- " \"%s\"." % (pn, licenses, element, license_operator.pattern))
+ bb.warn('%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \
+ 'in the valid list of separators (%s)' %
+ (pn, licenses, element, license_operator_chars))
SSTATETASKS += "do_populate_lic"
do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
def __str__(self):
return "invalid characters in license '%s'" % self.license
-license_operator = re.compile('([&|() ])')
+license_operator_chars = '&|() '
+license_operator = re.compile('([' + license_operator_chars + '])')
license_pattern = re.compile('[a-zA-Z0-9.+_\-]+$')
class LicenseVisitor(ast.NodeVisitor):