]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/create-spdx: Fix file:// in downloadLocation
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 1 Sep 2021 13:44:52 +0000 (08:44 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Sep 2021 08:03:36 +0000 (09:03 +0100)
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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/create-spdx.bbclass

index 2638b3dc97604fdcf12f62666f7e358809169764..aa640977f99862eea74a2397800288c8e55ea2ad 100644 (file)
@@ -362,9 +362,12 @@ python do_create_spdx() {
     recipe.versionInfo = d.getVar("PV")
     recipe.SPDXID = oe.sbom.get_recipe_spdxid(d)
 
-    src_uri = d.getVar('SRC_URI')
-    if src_uri:
-        recipe.downloadLocation = src_uri.split()[0]
+    for s in d.getVar('SRC_URI').split():
+        if not s.startswith("file://"):
+            recipe.downloadLocation = s
+            break
+    else:
+        recipe.downloadLocation = "NOASSERTION"
 
     homepage = d.getVar("HOMEPAGE")
     if homepage: