summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKamel Bouhara <kamel.bouhara@bootlin.com>2021-01-14 08:12:35 +0100
committerAnuj Mittal <anuj.mittal@intel.com>2021-02-06 14:53:56 +0800
commit6bcd2e242ef85cf875a2ea1a7c208f8c30fbdffa (patch)
tree81cffe69e7ac5bf4386238e82cdcd25ae1e257b1 /scripts
parent2c17be47120d388cffafe8213a4b8a92d537805c (diff)
downloadopenembedded-core-contrib-6bcd2e242ef85cf875a2ea1a7c208f8c30fbdffa.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. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ef153ad36d0299e83a03af8f207686d0d8a238b3) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'scripts')
-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):
self._run_npm_install(d, srctree, registry, dev)
shrinkwrap_file = self._generate_shrinkwrap(d, srctree, dev)
+ with open(shrinkwrap_file, "r") as f:
+ shrinkwrap = json.load(f)
+
if os.path.exists(lock_copy):
bb.utils.movefile(lock_copy, lock_file)
@@ -226,7 +229,8 @@ class NpmRecipeHandler(RecipeHandler):
value = origvalue.replace("version=" + data["version"], "version=${PV}")
value = value.replace("version=latest", "version=${PV}")
values = [line.strip() for line in value.strip('\n').splitlines()]
- values.append(url_recipe)
+ if "dependencies" in shrinkwrap:
+ values.append(url_recipe)
return values, None, 4, False
(_, newlines) = bb.utils.edit_metadata(lines_before, ["SRC_URI"], _handle_srcuri)