summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/npm.py41
1 files changed, 21 insertions, 20 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index f2e7983d8d..b5f148ca03 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -263,26 +263,27 @@ class Npm(FetchMethod):
263 runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest) 263 runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest)
264 return 264 return
265 265
266 shwrf = d.getVar('NPM_SHRINKWRAP') 266 if ud.parm.get("noverify", None) != '1':
267 logger.debug(2, "NPM shrinkwrap file is %s" % shwrf) 267 shwrf = d.getVar('NPM_SHRINKWRAP')
268 if shwrf: 268 logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
269 try: 269 if shwrf:
270 with open(shwrf) as datafile: 270 try:
271 shrinkobj = json.load(datafile) 271 with open(shwrf) as datafile:
272 except Exception as e: 272 shrinkobj = json.load(datafile)
273 raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e))) 273 except Exception as e:
274 elif not ud.ignore_checksums: 274 raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e)))
275 logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname) 275 elif not ud.ignore_checksums:
276 lckdf = d.getVar('NPM_LOCKDOWN') 276 logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
277 logger.debug(2, "NPM lockdown file is %s" % lckdf) 277 lckdf = d.getVar('NPM_LOCKDOWN')
278 if lckdf: 278 logger.debug(2, "NPM lockdown file is %s" % lckdf)
279 try: 279 if lckdf:
280 with open(lckdf) as datafile: 280 try:
281 lockdown = json.load(datafile) 281 with open(lckdf) as datafile:
282 except Exception as e: 282 lockdown = json.load(datafile)
283 raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e))) 283 except Exception as e:
284 elif not ud.ignore_checksums: 284 raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e)))
285 logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname) 285 elif not ud.ignore_checksums:
286 logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
286 287
287 if ('name' not in shrinkobj): 288 if ('name' not in shrinkobj):
288 self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud) 289 self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud)