summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
diff options
context:
space:
mode:
authorAnders Darander <anders@chargestorm.se>2017-02-24 21:52:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-24 13:12:48 -0800
commitd3bd41d0ec9621307c362b394872b18b8b7ed8d6 (patch)
tree50bc7bde0ab9ebff3f32752f87fd5244e596b3c3 /lib/bb/fetch2
parent628c4bf6c89b3d62c9b864380b5c8e131a899bff (diff)
downloadbitbake-contrib-d3bd41d0ec9621307c362b394872b18b8b7ed8d6.tar.gz
lib/bb/fetch2: rewrite / to - in package names
Most angular2 packages have names of the form @angular/xxx. The / obviously can't be used in a file name, replace it with -. Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/npm.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 15b281fb4..780f26d37 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -80,6 +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.bbnpmmanifest = ud.bbnpmmanifest.replace('/', '-')
ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
prefixdir = "npm/%s" % ud.pkgname
ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
@@ -92,6 +93,7 @@ class Npm(FetchMethod):
ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
+ ud.mirrortarball = ud.mirrortarball.replace('/', '-')
ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
def need_update(self, ud, d):
@@ -133,8 +135,7 @@ class Npm(FetchMethod):
def unpack(self, ud, destdir, d):
dldir = d.getVar("DL_DIR")
- depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version)
- with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile:
+ with open("%s/npm/%s" % (dldir, ud.bbnpmmanifest)) as datafile:
workobj = json.load(datafile)
dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)