diff options
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/fetch2/npm.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py index 699ae72e05..c3e02e47f0 100644 --- a/bitbake/lib/bb/fetch2/npm.py +++ b/bitbake/lib/bb/fetch2/npm.py | |||
| @@ -258,17 +258,23 @@ class Npm(FetchMethod): | |||
| 258 | 258 | ||
| 259 | shwrf = d.getVar('NPM_SHRINKWRAP', True) | 259 | shwrf = d.getVar('NPM_SHRINKWRAP', True) |
| 260 | logger.debug(2, "NPM shrinkwrap file is %s" % shwrf) | 260 | logger.debug(2, "NPM shrinkwrap file is %s" % shwrf) |
| 261 | try: | 261 | if shwrf: |
| 262 | with open(shwrf) as datafile: | 262 | try: |
| 263 | shrinkobj = json.load(datafile) | 263 | with open(shwrf) as datafile: |
| 264 | except: | 264 | shrinkobj = json.load(datafile) |
| 265 | except Exception as e: | ||
| 266 | raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e))) | ||
| 267 | elif not ud.ignore_checksums: | ||
| 265 | 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) |
| 266 | lckdf = d.getVar('NPM_LOCKDOWN', True) | 269 | lckdf = d.getVar('NPM_LOCKDOWN', True) |
| 267 | logger.debug(2, "NPM lockdown file is %s" % lckdf) | 270 | logger.debug(2, "NPM lockdown file is %s" % lckdf) |
| 268 | try: | 271 | if lckdf: |
| 269 | with open(lckdf) as datafile: | 272 | try: |
| 270 | lockdown = json.load(datafile) | 273 | with open(lckdf) as datafile: |
| 271 | except: | 274 | lockdown = json.load(datafile) |
| 275 | except Exception as e: | ||
| 276 | raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e))) | ||
| 277 | elif not ud.ignore_checksums: | ||
| 272 | logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname) | 278 | logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname) |
| 273 | 279 | ||
| 274 | if ('name' not in shrinkobj): | 280 | if ('name' not in shrinkobj): |
