aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBELOUARGA Mohamed <m.belouarga@technologyandstrategy.com>2023-07-21 01:41:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-04 11:45:57 +0100
commit48a102e49448656ef25fb689af7b0971fde523e3 (patch)
treecdb07a0ab72e3e746f0a52d3eac48c653fec7351
parent83f41281ec3d9b4327ffc8e2312e1fb8f53cbf02 (diff)
downloadbitbake-contrib-48a102e49448656ef25fb689af7b0971fde523e3.tar.gz
bitbake: fetch2/npmsw: Check if there are dependencies before trying to fetch them
When there are no dependencies, _foreach_proxy_method does not verify that there are dependencies to fetch before fetching them. Signed-off-by: BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/npmsw.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/bb/fetch2/npmsw.py b/lib/bb/fetch2/npmsw.py
index 971ccc905..4ff2c8ffc 100644
--- a/lib/bb/fetch2/npmsw.py
+++ b/lib/bb/fetch2/npmsw.py
@@ -225,13 +225,15 @@ class NpmShrinkWrap(FetchMethod):
@staticmethod
def _foreach_proxy_method(ud, handle):
returns = []
- for proxy_url in ud.proxy.urls:
- proxy_ud = ud.proxy.ud[proxy_url]
- proxy_d = ud.proxy.d
- proxy_ud.setup_localpath(proxy_d)
- lf = lockfile(proxy_ud.lockfile)
- returns.append(handle(proxy_ud.method, proxy_ud, proxy_d))
- unlockfile(lf)
+ #Check if there are dependencies before try to fetch them
+ if len(ud.deps) > 0:
+ for proxy_url in ud.proxy.urls:
+ proxy_ud = ud.proxy.ud[proxy_url]
+ proxy_d = ud.proxy.d
+ proxy_ud.setup_localpath(proxy_d)
+ lf = lockfile(proxy_ud.lockfile)
+ returns.append(handle(proxy_ud.method, proxy_ud, proxy_d))
+ unlockfile(lf)
return returns
def verify_donestamp(self, ud, d):