[OE-core] [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
Andrei Gherzan
andrei at gherzan.ro
Wed Jan 11 12:45:02 UTC 2012
From: Andrei Gherzan <andrei.gherzan at windriver.com>
Some upstream layers (ex: meta-oe) use '&&' or '||' syntax in LICENSE
variable. Because of my last commit, these bbfiles are failing as LICENSE
is tested with oe.license where '&&' and '||' are the bug source.
The fix is to replace multiple characters of '&' or '|' with a single one.
Signed-off-by: Andrei Gherzan <andrei at gherzan.ro>
---
meta/lib/oe/license.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index 7ab66e7..5b8d47c 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -18,6 +18,7 @@ license_pattern = re.compile('[a-zA-Z0-9.+_\-]+$')
class LicenseVisitor(ast.NodeVisitor):
"""Syntax tree visitor which can accept OpenEmbedded license strings"""
def visit_string(self, licensestr):
+ licensestr = re.sub(r'([|&])\1+', r'\1', licensestr)
new_elements = []
elements = filter(lambda x: x.strip(), license_operator.split(licensestr))
for pos, element in enumerate(elements):
--
1.7.5.4
More information about the Openembedded-core
mailing list