Skip to contentSkip to conversation

npm: in cases where shrinkwrap resolved a git URL, ignore it and grab dist.tarball

PATCH New [email protected] 1 participant 1 message Feb 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 npm: in cases where shrinkwrap resolved a git URL, ignore it and grab dist.tarball

From: Brendan Le Foll <[email protected]>

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.

---
 lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/npm.py +1 -1
index 212d167..44c181b 100644
@@ -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))
Signature · 1 line
2.7.1