Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Tweak license format messages
@ 2015-02-03 15:28 Paul Eggleton
  2015-02-03 15:28 ` [PATCH 1/1] classes/license: tweak " Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-02-03 15:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

Brought to you by the "keeping Koen happy" dept.

The following change since commit e48c06264f183c3d611a20a45914e9eeaa8f3736:

  libtool: Fix tools path issues (2015-02-03 14:29:56 +0000)

is available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/license-format
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/license-format

Paul Eggleton (1):
  classes/license: tweak license format messages

 meta/classes/license.bbclass | 15 ++++++++-------
 meta/lib/oe/license.py       |  3 ++-
 2 files changed, 10 insertions(+), 8 deletions(-)

-- 
1.9.3



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

* [PATCH 1/1] classes/license: tweak license format messages
  2015-02-03 15:28 [PATCH 0/1] Tweak license format messages Paul Eggleton
@ 2015-02-03 15:28 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-02-03 15:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

Strictly speaking not all of these characters are operators, so reword
the message to describe them as separators. Also use the standard
"recipename: message" format.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/license.bbclass | 15 ++++++++-------
 meta/lib/oe/license.py       |  3 ++-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index d659b76..21465d8 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -417,19 +417,20 @@ def check_license_format(d):
     """
     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}"
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index 340da61..31ca15b 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -25,7 +25,8 @@ class InvalidLicense(LicenseError):
     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):
-- 
1.9.3



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

end of thread, other threads:[~2015-02-03 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 15:28 [PATCH 0/1] Tweak license format messages Paul Eggleton
2015-02-03 15:28 ` [PATCH 1/1] classes/license: tweak " Paul Eggleton

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