npmsw fetcher: Avoid instantiating Fetch class if url list is empty
PATCH 1/1 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 still 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.
---lib/bb/fetch2/npmsw.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
lib/bb/fetch2/npmsw.py +0 -0
@@ -205,7 +205,9 @@ class NpmShrinkWrap(FetchMethod):
# This fetcher resolves multiple URIs from a shrinkwrap file and then
# forwards it to a proxy fetcher. The management of the donestamp file, # the lockfile and the checksums are forwarded to the proxy fetcher. - ud.proxy = Fetch([dep["url"] for dep in ud.deps if dep["url"]], data) + shrinkwrap_urls = [dep["url"] for dep in ud.deps if dep["url"]] + if shrinkwrap_urls: + ud.proxy = Fetch(shrinkwrap_urls, data) ud.needdonestamp = False
@staticmethod
--
2.39.2.windows.1
Hello Svend,
Quoted 9 lines · On Sun, 16 Apr 2023 13:07:15 -0700 [email protected] wrote:
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 still 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 theSRC_URIwhen the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty.Signed-off-by Svend Meyland Nicolaisen <[email protected]>
Thanks for your patch. However it does not apply using 'git am', because it is an HTML e-mail.
The simplest way to send a properly formatted patch is using 'git send-email'.
For more info read:
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
Signature · 3 lines
Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Svend
Quoted 14 lines · Luca Ceresoli via lists.openembedded.org
Hello Svend,
Quoted 9 lines · On Sun, 16 Apr 2023 13:07:15 -0700 [email protected] wrote:
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 still 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 theSRC_URIwhen the urls parameter contains an empty list. This patch will ensure that Fetch is not instantiated if the urls list is empty.Signed-off-by Svend Meyland Nicolaisen <[email protected]>
Quoted 8 lines
Thanks for your patch. However it does not apply using 'git am', because it is an HTML e-mail.
The simplest way to send a properly formatted patch is using 'git send-email'.
For more info read:
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
In particular, make sure you don't miss https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Fixing_your_From_identity, because the way your e-mail is configured, you won't have a correct git "Author" field, which should match your "Signed-off-by" information.
Thanks in advance :)
Cheers
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Thank you for your replies. I had a hassle getting SMTP to work using gmail.com. Now I have sent the patch using "my own" smtp server, wonder why I didn't do that on the first attempts.....
Anyway the patch sent using git send-email ended up in this thread. Is that OK?
Kind regards,
Svend
Hi Svend
Quoted 3 lines · Svend Meyland Nicolaisen
Thank you for your replies. I had a hassle getting SMTP to work using gmail.com. Now I have sent the patch using "my own" smtp server, wonder why I didn't do that on the first attempts.....
Anyway the patch sent using git send-email ended up in this thread. Is that OK?
Yes, everything looks good now and your patch applies nicely. Thanks!
Michael.
Signature · 3 lines
Michael Opdenacker, Bootlin Embedded Linux and Kernel engineering https://bootlin.com