Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
@ 2012-01-11 12:45 Andrei Gherzan
  2012-01-11 13:56 ` Paul Eggleton
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Gherzan @ 2012-01-11 12:45 UTC (permalink / raw)
  To: openembedded-core; +Cc: flocirel, Andrei Gherzan

From: Andrei Gherzan <andrei.gherzan@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@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




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-12 23:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 12:45 [PATCH] license.py: remove duplicate '&' or '|' from LICENSE Andrei Gherzan
2012-01-11 13:56 ` Paul Eggleton
2012-01-11 14:11   ` Andrei Gherzan
2012-01-12  7:19     ` Saul Wold
2012-01-12 11:55       ` Andrei Gherzan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox