]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: fix substring matching in COMMERCIAL_LICENSE
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 7 Sep 2011 16:05:42 +0000 (17:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Sep 2011 08:55:55 +0000 (09:55 +0100)
Previously, if for example you had a package called "mx", and a second
package called "libomxil" listed in COMMERCIAL_LICENSE (without mx being
listed there), it would match mx as being commercially licensed because
mx is a substring of libomxil. Fix the search to ensure it only matches
the listed package name exactly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass

index 3501f4becbf9fb86970232cd2e2f3576a3437830..104bec8628228eba196851bcc73bc8c2b1efae17 100644 (file)
@@ -340,9 +340,9 @@ python () {
     if license == "INVALID":
         bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
 
-    commercial_license = bb.data.getVar('COMMERCIAL_LICENSE', d, 1)
+    commercial_license = " %s " % bb.data.getVar('COMMERCIAL_LICENSE', d, 1)
     import re
-    pnr = pn.replace('+', "\+")
+    pnr = "[ \t]%s[ \t]" % pn.replace('+', "\+")
     if commercial_license and re.search(pnr, commercial_license):
         bb.debug(1, "Skipping %s because it's commercially licensed" % pn)
         raise bb.parse.SkipPackage("because it may require a commercial license to ship in a product (listed in COMMERCIAL_LICENSE)")