summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-02 23:45:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-04 23:39:00 +0000
commit7fa6eeba1c1e4667820c8543343083fad75cabee (patch)
tree1f1c38bf800d5b8aacf00586cb3ce5145109d4f5 /meta/classes/license.bbclass
parent252e64550a77b8e4a452d4f124bb8b378054d4de (diff)
downloadpoky-7fa6eeba1c1e4667820c8543343083fad75cabee.tar.gz
classes/lib: Add expand parameter to getVarFlag
This sets the scene for removing the default False for expansion from getVarFlag. This would later allow True to become the default. On the most part this is an automatic translation with: sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g' -i `grep -ril getVar *` In this case, the default was False, but True was used since in most cases here expansion would be expected. (From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 301216d5d6..fe38d2152c 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -416,10 +416,10 @@ def find_license_files(d):
416 416
417 for lic_dir in license_source_dirs: 417 for lic_dir in license_source_dirs:
418 if not os.path.isfile(os.path.join(lic_dir, license_type)): 418 if not os.path.isfile(os.path.join(lic_dir, license_type)):
419 if d.getVarFlag('SPDXLICENSEMAP', license_type) != None: 419 if d.getVarFlag('SPDXLICENSEMAP', license_type, True) != None:
420 # Great, there is an SPDXLICENSEMAP. We can copy! 420 # Great, there is an SPDXLICENSEMAP. We can copy!
421 bb.debug(1, "We need to use a SPDXLICENSEMAP for %s" % (license_type)) 421 bb.debug(1, "We need to use a SPDXLICENSEMAP for %s" % (license_type))
422 spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type) 422 spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type, True)
423 license_source = lic_dir 423 license_source = lic_dir
424 break 424 break
425 elif os.path.isfile(os.path.join(lic_dir, license_type)): 425 elif os.path.isfile(os.path.join(lic_dir, license_type)):
@@ -435,14 +435,14 @@ def find_license_files(d):
435 435
436 # The user may attempt to use NO_GENERIC_LICENSE for a generic license which doesn't make sense 436 # The user may attempt to use NO_GENERIC_LICENSE for a generic license which doesn't make sense
437 # and should not be allowed, warn the user in this case. 437 # and should not be allowed, warn the user in this case.
438 if d.getVarFlag('NO_GENERIC_LICENSE', license_type): 438 if d.getVarFlag('NO_GENERIC_LICENSE', license_type, True):
439 bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type)) 439 bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type))
440 440
441 elif d.getVarFlag('NO_GENERIC_LICENSE', license_type): 441 elif d.getVarFlag('NO_GENERIC_LICENSE', license_type, True):
442 # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source 442 # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source
443 # of the package rather than the license_source_dirs. 443 # of the package rather than the license_source_dirs.
444 for (basename, path) in lic_files_paths: 444 for (basename, path) in lic_files_paths:
445 if d.getVarFlag('NO_GENERIC_LICENSE', license_type) == basename: 445 if d.getVarFlag('NO_GENERIC_LICENSE', license_type, True) == basename:
446 lic_files_paths.append(("generic_" + license_type, path)) 446 lic_files_paths.append(("generic_" + license_type, path))
447 break 447 break
448 else: 448 else:
@@ -510,7 +510,7 @@ def expand_wildcard_licenses(d, wildcard_licenses):
510 spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys() 510 spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
511 for wld_lic in wildcard_licenses: 511 for wld_lic in wildcard_licenses:
512 spdxflags = fnmatch.filter(spdxmapkeys, wld_lic) 512 spdxflags = fnmatch.filter(spdxmapkeys, wld_lic)
513 licenses += [d.getVarFlag('SPDXLICENSEMAP', flag) for flag in spdxflags] 513 licenses += [d.getVarFlag('SPDXLICENSEMAP', flag, True) for flag in spdxflags]
514 514
515 spdx_lics = (d.getVar('SRC_DISTRIBUTE_LICENSES', False) or '').split() 515 spdx_lics = (d.getVar('SRC_DISTRIBUTE_LICENSES', False) or '').split()
516 for wld_lic in wildcard_licenses: 516 for wld_lic in wildcard_licenses: