summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/npm.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/npm.py')
-rw-r--r--bitbake/lib/bb/fetch2/npm.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 66ab075b1c..cbeb8ff889 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -87,12 +87,12 @@ class Npm(FetchMethod):
87 bb.utils.mkdirhier(ud.pkgdatadir) 87 bb.utils.mkdirhier(ud.pkgdatadir)
88 ud.localpath = d.expand("${DL_DIR}/npm/%s" % ud.bbnpmmanifest) 88 ud.localpath = d.expand("${DL_DIR}/npm/%s" % ud.bbnpmmanifest)
89 89
90 self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate " 90 self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
91 ud.prefixdir = prefixdir 91 ud.prefixdir = prefixdir
92 92
93 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS", True) or "0") != "0") 93 ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
94 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version) 94 ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
95 ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball) 95 ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
96 96
97 def need_update(self, ud, d): 97 def need_update(self, ud, d):
98 if os.path.exists(ud.localpath): 98 if os.path.exists(ud.localpath):
@@ -102,7 +102,7 @@ class Npm(FetchMethod):
102 def _runwget(self, ud, d, command, quiet): 102 def _runwget(self, ud, d, command, quiet):
103 logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command)) 103 logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
104 bb.fetch2.check_network_access(d, command) 104 bb.fetch2.check_network_access(d, command)
105 dldir = d.getVar("DL_DIR", True) 105 dldir = d.getVar("DL_DIR")
106 runfetchcmd(command, d, quiet, workdir=dldir) 106 runfetchcmd(command, d, quiet, workdir=dldir)
107 107
108 def _unpackdep(self, ud, pkg, data, destdir, dldir, d): 108 def _unpackdep(self, ud, pkg, data, destdir, dldir, d):
@@ -116,7 +116,7 @@ class Npm(FetchMethod):
116 # Change to subdir before executing command 116 # Change to subdir before executing command
117 if not os.path.exists(destdir): 117 if not os.path.exists(destdir):
118 os.makedirs(destdir) 118 os.makedirs(destdir)
119 path = d.getVar('PATH', True) 119 path = d.getVar('PATH')
120 if path: 120 if path:
121 cmd = "PATH=\"%s\" %s" % (path, cmd) 121 cmd = "PATH=\"%s\" %s" % (path, cmd)
122 bb.note("Unpacking %s to %s/" % (file, destdir)) 122 bb.note("Unpacking %s to %s/" % (file, destdir))
@@ -132,7 +132,7 @@ class Npm(FetchMethod):
132 132
133 133
134 def unpack(self, ud, destdir, d): 134 def unpack(self, ud, destdir, d):
135 dldir = d.getVar("DL_DIR", True) 135 dldir = d.getVar("DL_DIR")
136 depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version) 136 depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version)
137 with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile: 137 with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile:
138 workobj = json.load(datafile) 138 workobj = json.load(datafile)
@@ -251,12 +251,12 @@ class Npm(FetchMethod):
251 lockdown = {} 251 lockdown = {}
252 252
253 if not os.listdir(ud.pkgdatadir) and os.path.exists(ud.fullmirror): 253 if not os.listdir(ud.pkgdatadir) and os.path.exists(ud.fullmirror):
254 dest = d.getVar("DL_DIR", True) 254 dest = d.getVar("DL_DIR")
255 bb.utils.mkdirhier(dest) 255 bb.utils.mkdirhier(dest)
256 runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest) 256 runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest)
257 return 257 return
258 258
259 shwrf = d.getVar('NPM_SHRINKWRAP', True) 259 shwrf = d.getVar('NPM_SHRINKWRAP')
260 logger.debug(2, "NPM shrinkwrap file is %s" % shwrf) 260 logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
261 if shwrf: 261 if shwrf:
262 try: 262 try:
@@ -266,7 +266,7 @@ class Npm(FetchMethod):
266 raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e))) 266 raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e)))
267 elif not ud.ignore_checksums: 267 elif not ud.ignore_checksums:
268 logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname) 268 logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
269 lckdf = d.getVar('NPM_LOCKDOWN', True) 269 lckdf = d.getVar('NPM_LOCKDOWN')
270 logger.debug(2, "NPM lockdown file is %s" % lckdf) 270 logger.debug(2, "NPM lockdown file is %s" % lckdf)
271 if lckdf: 271 if lckdf:
272 try: 272 try:
@@ -292,7 +292,7 @@ class Npm(FetchMethod):
292 if os.path.islink(ud.fullmirror): 292 if os.path.islink(ud.fullmirror):
293 os.unlink(ud.fullmirror) 293 os.unlink(ud.fullmirror)
294 294
295 dldir = d.getVar("DL_DIR", True) 295 dldir = d.getVar("DL_DIR")
296 logger.info("Creating tarball of npm data") 296 logger.info("Creating tarball of npm data")
297 runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d, 297 runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d,
298 workdir=dldir) 298 workdir=dldir)