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

* Re: [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-01-11 13:56 UTC (permalink / raw)
  To: openembedded-core

On Wednesday 11 January 2012 14:45:02 Andrei Gherzan wrote:
> 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.

Sorry to be a pain but could we not just fix those layers to use the accepted 
syntax? Doing so should be just a one-line find/sed command.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



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

* Re: [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
  2012-01-11 13:56 ` Paul Eggleton
@ 2012-01-11 14:11   ` Andrei Gherzan
  2012-01-12  7:19     ` Saul Wold
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Gherzan @ 2012-01-11 14:11 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

On 01/11/2012 03:56 PM, Paul Eggleton wrote:
> On Wednesday 11 January 2012 14:45:02 Andrei Gherzan wrote:
>> 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.
> Sorry to be a pain but could we not just fix those layers to use the accepted
> syntax? Doing so should be just a one-line find/sed command.
>
> Cheers,
> Paul
>
That'd be a solution as well but because those files were accepted this 
way until now i thought that this is an accepted syntax. More, this 
would scale and give a little freedom to the developers especially for 
those that are coming from "C" part or the world. (smile)

ag



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

* Re: [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
  2012-01-11 14:11   ` Andrei Gherzan
@ 2012-01-12  7:19     ` Saul Wold
  2012-01-12 11:55       ` Andrei Gherzan
  0 siblings, 1 reply; 5+ messages in thread
From: Saul Wold @ 2012-01-12  7:19 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Paul Eggleton

On 01/11/2012 06:11 AM, Andrei Gherzan wrote:
> On 01/11/2012 03:56 PM, Paul Eggleton wrote:
>> On Wednesday 11 January 2012 14:45:02 Andrei Gherzan wrote:
>>> 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.
>> Sorry to be a pain but could we not just fix those layers to use the
>> accepted
>> syntax? Doing so should be just a one-line find/sed command.
>>
>> Cheers,
>> Paul
>>
> That'd be a solution as well but because those files were accepted this
> way until now i thought that this is an accepted syntax. More, this
> would scale and give a little freedom to the developers especially for
> those that are coming from "C" part or the world. (smile)
>
I think I agree with Paul here, Beth has sent out a proposal for that 
and by making a change here may allow the bad behavior to continue.

Sau!

> ag
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



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

* Re: [PATCH] license.py: remove duplicate '&' or '|' from LICENSE
  2012-01-12  7:19     ` Saul Wold
@ 2012-01-12 11:55       ` Andrei Gherzan
  0 siblings, 0 replies; 5+ messages in thread
From: Andrei Gherzan @ 2012-01-12 11:55 UTC (permalink / raw)
  To: Saul Wold; +Cc: Paul Eggleton, Patches and discussions about the oe-core layer

On 01/12/2012 09:19 AM, Saul Wold wrote:
> I think I agree with Paul here, Beth has sent out a proposal for that 
> and by making a change here may allow the bad behavior to continue.
>
> Sau!

In this case we can drop this and the problem will remain (will have to 
be fixed) in meta-oe layers.

@g



^ permalink raw reply	[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