mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
license.bbclass: Whitespace standardization
Removing tabs within check_license_flags to standardize to 4 space tabbing (From OE-Core rev: 178be339e09078c56a5231a10551f3b9aed16f9c) Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5de2b70afc
commit
a3da6c381f
@@ -266,23 +266,23 @@ def incompatible_license(d,dont_want_license):
|
|||||||
dont_want_licenses = []
|
dont_want_licenses = []
|
||||||
dont_want_licenses.append(d.getVar('INCOMPATIBLE_LICENSE', True))
|
dont_want_licenses.append(d.getVar('INCOMPATIBLE_LICENSE', True))
|
||||||
if d.getVarFlag('SPDXLICENSEMAP', dont_want_license):
|
if d.getVarFlag('SPDXLICENSEMAP', dont_want_license):
|
||||||
dont_want_licenses.append(d.getVarFlag('SPDXLICENSEMAP', dont_want_license))
|
dont_want_licenses.append(d.getVarFlag('SPDXLICENSEMAP', dont_want_license))
|
||||||
|
|
||||||
def include_license(license):
|
def include_license(license):
|
||||||
if any(fnmatch(license, pattern) for pattern in dont_want_licenses):
|
if any(fnmatch(license, pattern) for pattern in dont_want_licenses):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
spdx_license = d.getVarFlag('SPDXLICENSEMAP', license)
|
spdx_license = d.getVarFlag('SPDXLICENSEMAP', license)
|
||||||
if spdx_license and any(fnmatch(spdx_license, pattern) for pattern in dont_want_licenses):
|
if spdx_license and any(fnmatch(spdx_license, pattern) for pattern in dont_want_licenses):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def choose_licenses(a, b):
|
def choose_licenses(a, b):
|
||||||
if all(include_license(lic) for lic in a):
|
if all(include_license(lic) for lic in a):
|
||||||
return a
|
return a
|
||||||
else:
|
else:
|
||||||
return b
|
return b
|
||||||
|
|
||||||
"""
|
"""
|
||||||
If you want to exlude license named generically 'X', we surely want to exlude 'X+' as well.
|
If you want to exlude license named generically 'X', we surely want to exlude 'X+' as well.
|
||||||
@@ -290,13 +290,13 @@ def incompatible_license(d,dont_want_license):
|
|||||||
is not a 'X+' license.
|
is not a 'X+' license.
|
||||||
"""
|
"""
|
||||||
if not re.search(r'[+]',dont_want_license):
|
if not re.search(r'[+]',dont_want_license):
|
||||||
licenses=oe.license.flattened_licenses(re.sub(r'[+]', '', d.getVar('LICENSE', True)), choose_licenses)
|
licenses=oe.license.flattened_licenses(re.sub(r'[+]', '', d.getVar('LICENSE', True)), choose_licenses)
|
||||||
else:
|
else:
|
||||||
licenses=oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses)
|
licenses=oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses)
|
||||||
|
|
||||||
for onelicense in licenses:
|
for onelicense in licenses:
|
||||||
if not include_license(onelicense):
|
if not include_license(onelicense):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@@ -361,7 +361,6 @@ def check_license_flags(d):
|
|||||||
return unmatched_flag
|
return unmatched_flag
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
SSTATETASKS += "do_populate_lic"
|
SSTATETASKS += "do_populate_lic"
|
||||||
do_populate_lic[sstate-name] = "populate-lic"
|
do_populate_lic[sstate-name] = "populate-lic"
|
||||||
do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
|
do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
|
||||||
|
|||||||
Reference in New Issue
Block a user