summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-09-01 08:44:52 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-03 09:53:29 +0100
commitde3b8717863c4fd78d16852bf9c6f7b67dda57fd (patch)
tree74163595295e2760dd586cd32fe99d9a435700fb
parentbeeb0f9e53a7629a21679107db46e33e032a4d90 (diff)
downloadpoky-de3b8717863c4fd78d16852bf9c6f7b67dda57fd.tar.gz
classes/create-spdx: Fix file:// in downloadLocation
file:// URIs should not be included as the downloadLocation. Instead, loop until a non-file:// URI is found, or set the location to NOASSERTION if none is found (From OE-Core rev: 19c61ec3986213b336d965d90b1329085e7d6179) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/create-spdx.bbclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index 2638b3dc97..aa640977f9 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -362,9 +362,12 @@ python do_create_spdx() {
362 recipe.versionInfo = d.getVar("PV") 362 recipe.versionInfo = d.getVar("PV")
363 recipe.SPDXID = oe.sbom.get_recipe_spdxid(d) 363 recipe.SPDXID = oe.sbom.get_recipe_spdxid(d)
364 364
365 src_uri = d.getVar('SRC_URI') 365 for s in d.getVar('SRC_URI').split():
366 if src_uri: 366 if not s.startswith("file://"):
367 recipe.downloadLocation = src_uri.split()[0] 367 recipe.downloadLocation = s
368 break
369 else:
370 recipe.downloadLocation = "NOASSERTION"
368 371
369 homepage = d.getVar("HOMEPAGE") 372 homepage = d.getVar("HOMEPAGE")
370 if homepage: 373 if homepage: