diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-08-31 11:30:47 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 23:30:04 +0100 |
commit | 29c8eb4759714ace5056933e793076cbc4377888 (patch) | |
tree | 18d9c8272e3152ce89f4f4c7818b96bfbdfac0a5 /bitbake | |
parent | 1524222c84ebaae8cd2add016f7f33ac1c20bfdd (diff) | |
download | poky-29c8eb4759714ace5056933e793076cbc4377888.tar.gz |
bitbake: fetch2/npm: add noverify parameter to skip lockdown/shrinkwrap
When fetching source for the first time within scripts such as
OpenEmbedded's recipetool, we don't want to be showing warnings about
NPM_SHRINKWRAP or NPM_LOCKDOWN not being set since there's no way we
could have set them in advance. Previously we were using
ud.ignore_checksums to suppress these but since we are now using a more
standard task-based path to fetch the source, we need to disable these
through the metadata. Look for a "noverify" parameter set on the npm URL
and skip the checks if it is set to "1".
(Bitbake rev: 8c4b35d1e4d31bae9fddd129d5ba230acb72c3bb)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/npm.py | 41 |
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) |