mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
oe/license_finder: don't return the "crunched" license text in crunch_license
crunch_license() will perform some basic text manipulation to try and canonicalise the license texts. It also returns the new license text but none of the callers use this, and as a slightly mangled version of the original it has no real purpose. Remove this return value and clean up the callers. (From OE-Core rev: 34603ed3b4919dcfba19ef57db11a6d3bb2704f1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
0d175076fe
commit
dd8f320184
|
@ -51,7 +51,7 @@ def crunch_known_licenses(d):
|
||||||
|
|
||||||
commonlicdir = d.getVar('COMMON_LICENSE_DIR')
|
commonlicdir = d.getVar('COMMON_LICENSE_DIR')
|
||||||
for fn in sorted(os.listdir(commonlicdir)):
|
for fn in sorted(os.listdir(commonlicdir)):
|
||||||
md5value, lictext = crunch_license(os.path.join(commonlicdir, fn))
|
md5value = crunch_license(os.path.join(commonlicdir, fn))
|
||||||
if md5value not in crunched_md5sums:
|
if md5value not in crunched_md5sums:
|
||||||
crunched_md5sums[md5value] = fn
|
crunched_md5sums[md5value] = fn
|
||||||
elif fn != crunched_md5sums[md5value]:
|
elif fn != crunched_md5sums[md5value]:
|
||||||
|
@ -123,8 +123,7 @@ def crunch_license(licfile):
|
||||||
md5val = m.hexdigest()
|
md5val = m.hexdigest()
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
md5val = None
|
md5val = None
|
||||||
lictext = ''
|
return md5val
|
||||||
return md5val, lictext
|
|
||||||
|
|
||||||
|
|
||||||
def find_license_files(srctree, first_only=False):
|
def find_license_files(srctree, first_only=False):
|
||||||
|
@ -164,15 +163,15 @@ def match_licenses(licfiles, srctree, d):
|
||||||
md5value = bb.utils.md5_file(resolved_licfile)
|
md5value = bb.utils.md5_file(resolved_licfile)
|
||||||
license = md5sums.get(md5value, None)
|
license = md5sums.get(md5value, None)
|
||||||
if not license:
|
if not license:
|
||||||
crunched_md5, lictext = crunch_license(resolved_licfile)
|
crunched_md5 = crunch_license(resolved_licfile)
|
||||||
license = crunched_md5sums.get(crunched_md5, None)
|
license = crunched_md5sums.get(crunched_md5, None)
|
||||||
if lictext and not license:
|
if not license:
|
||||||
license = 'Unknown'
|
license = 'Unknown'
|
||||||
logger.info("Please add the following line for '%s' to a 'license-hashes.csv' " \
|
logger.info("Please add the following line for '%s' to a 'license-hashes.csv' " \
|
||||||
"and replace `Unknown` with the license:\n" \
|
"and replace `Unknown` with the license:\n" \
|
||||||
"%s,Unknown" % (os.path.relpath(licfile, srctree + "/.."), md5value))
|
"%s,Unknown" % (os.path.relpath(licfile, srctree + "/.."), md5value))
|
||||||
if license:
|
|
||||||
licenses.append((license, os.path.relpath(licfile, srctree), md5value))
|
licenses.append((license, os.path.relpath(licfile, srctree), md5value))
|
||||||
|
|
||||||
return licenses
|
return licenses
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user