summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorKamel Bouhara <kamel.bouhara@bootlin.com>2021-01-14 08:12:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-16 22:39:36 +0000
commit93543e99605684d65125859ce1104ea74e2452cf (patch)
tree6e21a99d4817ba0ebe70661e83307d3f3dfa16e0 /scripts/lib
parent8b0884569f09873ca0aefcaeec00e371d7df5909 (diff)
downloadpoky-93543e99605684d65125859ce1104ea74e2452cf.tar.gz
recipetool: create: only add npmsw url if required
Before adding a npmsw fetcher to a recipe we should first check if the generated shrinkwrap file contains dependencies. (From OE-Core rev: ef153ad36d0299e83a03af8f207686d0d8a238b3) Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/create_npm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index 579b7ae48a..2bcae91dfa 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -204,6 +204,9 @@ class NpmRecipeHandler(RecipeHandler):
204 self._run_npm_install(d, srctree, registry, dev) 204 self._run_npm_install(d, srctree, registry, dev)
205 shrinkwrap_file = self._generate_shrinkwrap(d, srctree, dev) 205 shrinkwrap_file = self._generate_shrinkwrap(d, srctree, dev)
206 206
207 with open(shrinkwrap_file, "r") as f:
208 shrinkwrap = json.load(f)
209
207 if os.path.exists(lock_copy): 210 if os.path.exists(lock_copy):
208 bb.utils.movefile(lock_copy, lock_file) 211 bb.utils.movefile(lock_copy, lock_file)
209 212
@@ -226,7 +229,8 @@ class NpmRecipeHandler(RecipeHandler):
226 value = origvalue.replace("version=" + data["version"], "version=${PV}") 229 value = origvalue.replace("version=" + data["version"], "version=${PV}")
227 value = value.replace("version=latest", "version=${PV}") 230 value = value.replace("version=latest", "version=${PV}")
228 values = [line.strip() for line in value.strip('\n').splitlines()] 231 values = [line.strip() for line in value.strip('\n').splitlines()]
229 values.append(url_recipe) 232 if "dependencies" in shrinkwrap:
233 values.append(url_recipe)
230 return values, None, 4, False 234 return values, None, 4, False
231 235
232 (_, newlines) = bb.utils.edit_metadata(lines_before, ["SRC_URI"], _handle_srcuri) 236 (_, newlines) = bb.utils.edit_metadata(lines_before, ["SRC_URI"], _handle_srcuri)