Skip to contentSkip to conversation

fetch2/npm: fix ud.registry so that alternative registries can be handled

PATCH New [email protected] 1 participant 1 message Mar 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/npm: fix ud.registry so that alternative registries can be handled

From: Brendan Le Foll <[email protected]>

Fixes [YOCTO #9231]

npm when given an invalid registry URL with --registry actually goes and fetches from the default registry, but this commit makes sure it goes to the specified one.

---
 lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/npm.py +1 -1
index d44454c..e8d9b11 100644
@@ -80,7 +80,7 @@ class Npm(FetchMethod):
         if not ud.version:
             raise ParameterError("NPM fetcher requires a version parameter", ud.url)
         ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version)
-        ud.registry = "http://%s" % ud.basename
+        ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
         prefixdir = "npm/%s" % ud.pkgname
         ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
         if not os.path.exists(ud.pkgdatadir):
Signature · 1 line
2.7.2