]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
npm: in cases where shrinkwrap resolved a git URL, ignore it and grab dist.tarball
authorBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 29 Feb 2016 14:27:43 +0000 (14:27 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Mar 2016 22:40:50 +0000 (22:40 +0000)
npm-shrinkwrap will sometimes resolve a git URL which instead of a http url, in
this case go and grab the dist.tarball via npm instead of using the resolved
URL.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/npm.py

index 7d5e8913fbf7cedd7d0faae33a7698ecec7835a9..46644f1bba2840426bee585a36ef0ef73f79a5ce 100644 (file)
@@ -175,7 +175,7 @@ class Npm(FetchMethod):
     def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest):
         logger.debug(2, "NPM shrinkwrap file is %s" % data)
         outputurl = "invalid"
-        if ('resolved' not in data):
+        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
             # will be the case for ${PN}
             fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
             logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))