summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-09-07 17:05:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-08 09:56:31 +0100
commit95d39888466114f1e1fa81a7f78030f228c399fb (patch)
tree5d55ac0ab54c34795a93e33f9dccf1d1d99b431b
parent52835dd30110d51a839872f198eef3b12e369850 (diff)
downloadpoky-95d39888466114f1e1fa81a7f78030f228c399fb.tar.gz
base.bbclass: fix substring matching in COMMERCIAL_LICENSE
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. (From OE-Core rev: b23e51e6c961cf3f7e2aaf89648fecce78424c99) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 3501f4becb..104bec8628 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -340,9 +340,9 @@ python () {
340 if license == "INVALID": 340 if license == "INVALID":
341 bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn) 341 bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
342 342
343 commercial_license = bb.data.getVar('COMMERCIAL_LICENSE', d, 1) 343 commercial_license = " %s " % bb.data.getVar('COMMERCIAL_LICENSE', d, 1)
344 import re 344 import re
345 pnr = pn.replace('+', "\+") 345 pnr = "[ \t]%s[ \t]" % pn.replace('+', "\+")
346 if commercial_license and re.search(pnr, commercial_license): 346 if commercial_license and re.search(pnr, commercial_license):
347 bb.debug(1, "Skipping %s because it's commercially licensed" % pn) 347 bb.debug(1, "Skipping %s because it's commercially licensed" % pn)
348 raise bb.parse.SkipPackage("because it may require a commercial license to ship in a product (listed in COMMERCIAL_LICENSE)") 348 raise bb.parse.SkipPackage("because it may require a commercial license to ship in a product (listed in COMMERCIAL_LICENSE)")