]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
recipetool/create: show more of the license path when it can't be identified
authorRoss Burton <ross.burton@arm.com>
Wed, 4 Jun 2025 14:03:22 +0000 (15:03 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Jun 2025 10:01:24 +0000 (11:01 +0100)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create.py

index ea2ef5be637db7f58258eb6d5e35131386cafe1d..94d52d60772775095bc877571cd807dbd1beca61 100644 (file)
@@ -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))