summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvend Meyland Nicolaisen <public@smn.dk>2023-04-18 22:49:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-20 11:59:14 +0100
commit1a1025658c61d91b1f19663cdeb9432676f88787 (patch)
tree8e9d0cf75e0809e3b7f026a5ddea3008929ea161
parent6fedd43f9631c63d6389d9dc7112d6db1877e582 (diff)
downloadpoky-1a1025658c61d91b1f19663cdeb9432676f88787.tar.gz
bitbake: npmsw fetcher: Avoid instantiating Fetch class if url list is empty
Recipes containing both git and npmsw sources in the SRC_URI fail during fetch from the shrinkwrap. It seems that when the fetcher is fetching from the shrinkwrap, the SRCREV variable has been deleted but it till ends up fetching from the git source resulting in an error because SRCREV is undefined. The root cause of this is that the Fetch class defaults to urls from the SRC_URI when the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty. (Bitbake rev: e602963dfd505eef08702366383358d29ee20c4d) Signed-off-by: Svend Meyland Nicolaisen <public@smn.dk> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/npmsw.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/npmsw.py b/bitbake/lib/bb/fetch2/npmsw.py
index 36fcbfba15..cc81100b3a 100644
--- a/bitbake/lib/bb/fetch2/npmsw.py
+++ b/bitbake/lib/bb/fetch2/npmsw.py
@@ -205,7 +205,9 @@ class NpmShrinkWrap(FetchMethod):
205 # This fetcher resolves multiple URIs from a shrinkwrap file and then 205 # This fetcher resolves multiple URIs from a shrinkwrap file and then
206 # forwards it to a proxy fetcher. The management of the donestamp file, 206 # forwards it to a proxy fetcher. The management of the donestamp file,
207 # the lockfile and the checksums are forwarded to the proxy fetcher. 207 # the lockfile and the checksums are forwarded to the proxy fetcher.
208 ud.proxy = Fetch([dep["url"] for dep in ud.deps if dep["url"]], data) 208 shrinkwrap_urls = [dep["url"] for dep in ud.deps if dep["url"]]
209 if shrinkwrap_urls:
210 ud.proxy = Fetch(shrinkwrap_urls, data)
209 ud.needdonestamp = False 211 ud.needdonestamp = False
210 212
211 @staticmethod 213 @staticmethod