From patchwork Mon Apr 17 21:01:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svend Meyland Nicolaisen X-Patchwork-Id: 22735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC09EC77B76 for ; Mon, 17 Apr 2023 21:01:52 +0000 (UTC) Received: from server6121.serverpark.dk (server6121.serverpark.dk [80.208.28.131]) by mx.groups.io with SMTP id smtpd.web11.8961.1681765305141137454 for ; Mon, 17 Apr 2023 14:01:46 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: smn.dk, ip: 80.208.28.131, mailfrom: public@smn.dk) Received: from localhost (unknown [127.0.0.1]) by server6121.serverpark.dk (Postfix) with ESMTP id BDFB43B407F0; Mon, 17 Apr 2023 21:01:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at server6121.serverpark.dk Received: from server6121.serverpark.dk ([127.0.0.1]) by localhost (server6121.serverpark.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YxPIZQarNoRa; Mon, 17 Apr 2023 23:01:34 +0200 (CEST) Received: from dk-svni-01-7770.nktri.local (130228029038.mbb.telenor.dk [130.228.29.38]) (Authenticated sender: public@smn.dk) by server6121.serverpark.dk (Postfix) with ESMTPSA id 799773B407C8; Mon, 17 Apr 2023 23:01:33 +0200 (CEST) From: Svend Meyland Nicolaisen To: bitbake-devel@lists.openembedded.org Cc: Svend Meyland Nicolaisen Subject: [PATCH] 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. Date: Mon, 17 Apr 2023 23:01:29 +0200 Message-Id: <20230417210129.1534-1-public@smn.dk> X-Mailer: git-send-email 2.39.2.windows.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 17 Apr 2023 21:01:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14710 From: Svend Meyland Nicolaisen Signed-off-by: Svend Meyland Nicolaisen --- lib/bb/fetch2/npmsw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/npmsw.py b/lib/bb/fetch2/npmsw.py index 36fcbfba..cc81100b 100644 --- a/lib/bb/fetch2/npmsw.py +++ b/lib/bb/fetch2/npmsw.py @@ -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