aboutsummaryrefslogtreecommitdiffstats
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:03:36 +0100
commit19c61ec3986213b336d965d90b1329085e7d6179 (patch)
treef819bcabeecca8156273d731408057448ddbc532
parenta6d9de5350937c7e25899491db59f473345f0b69 (diff)
downloadopenembedded-core-contrib-19c61ec3986213b336d965d90b1329085e7d6179.tar.gz
openembedded-core-contrib-19c61ec3986213b336d965d90b1329085e7d6179.tar.bz2
openembedded-core-contrib-19c61ec3986213b336d965d90b1329085e7d6179.zip
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 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() {
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: