From: Ross Burton Date: Wed, 4 Jun 2025 14:03:22 +0000 (+0100) Subject: recipetool/create: show more of the license path when it can't be identified X-Git-Tag: uninative-4.8~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9679f4055ad5a077c6b06aa6125cee4e8fa93471;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git recipetool/create: show more of the license path when it can't be identified If there are multiple source trees in a project (incredibly common with go-mod, for example) then the relative path of the LICENSE file from the source tree could just be "LICENSE", which is not useful when there are tens of files across the recipe with that name. Show the parent directory name too, to clarify which file is unknown. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index ea2ef5be637..94d52d60772 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -1250,7 +1250,7 @@ def match_licenses(licfiles, srctree, d): license = 'Unknown' logger.info("Please add the following line for '%s' to a 'lib/recipetool/licenses.csv' " \ "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))