summaryrefslogtreecommitdiffstats
path: root/bitbake/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-03-01 11:16:07 +0000
commit32428263047c3dabdc06556242c3baaedac664ad (patch)
tree85798ac981e68e7853f6fd34c5e0ac2b2288048d /bitbake/lib/bb/fetch2
parent4b70f27173187ce9bc91193b994a67a9084ad861 (diff)
downloadpoky-32428263047c3dabdc06556242c3baaedac664ad.tar.gz
bitbake: 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 -. (Bitbake rev: d3bd41d0ec9621307c362b394872b18b8b7ed8d6) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/npm.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 15b281fb4f..780f26d37f 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -80,6 +80,7 @@ class Npm(FetchMethod):
80 if not ud.version: 80 if not ud.version:
81 raise ParameterError("NPM fetcher requires a version parameter", ud.url) 81 raise ParameterError("NPM fetcher requires a version parameter", ud.url)
82 ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version) 82 ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version)
83 ud.bbnpmmanifest = ud.bbnpmmanifest.replace('/', '-')
83 ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0] 84 ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
84 prefixdir = "npm/%s" % ud.pkgname 85 prefixdir = "npm/%s" % ud.pkgname
85 ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir) 86 ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
@@ -92,6 +93,7 @@ class Npm(FetchMethod):
92 93
93 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0") 94 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
94 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version) 95 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
96 ud.mirrortarball = ud.mirrortarball.replace('/', '-')
95 ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball) 97 ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
96 98
97 def need_update(self, ud, d): 99 def need_update(self, ud, d):
@@ -133,8 +135,7 @@ class Npm(FetchMethod):
133 135
134 def unpack(self, ud, destdir, d): 136 def unpack(self, ud, destdir, d):
135 dldir = d.getVar("DL_DIR") 137 dldir = d.getVar("DL_DIR")
136 depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version) 138 with open("%s/npm/%s" % (dldir, ud.bbnpmmanifest)) as datafile:
137 with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile:
138 workobj = json.load(datafile) 139 workobj = json.load(datafile)
139 dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname) 140 dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)
140 141