diff options
author | Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> | 2020-01-24 18:07:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:48:09 +0000 |
commit | 8f39026f1acee0a13c1ebc405a195c2879a0e604 (patch) | |
tree | a1f81da8b18e3ab13d01408114f37aa139699918 /meta | |
parent | de39f14d24a81d1f042cbcc4be6739e3e8000369 (diff) | |
download | poky-8f39026f1acee0a13c1ebc405a195c2879a0e604.tar.gz |
classes/npm: restrict the build to be offline
After the do_fetch task, every other tasks must not access the network.
In order to ensure this point every npm command must use the offline
configuration. In addition setting an invalid proxy is used as a safety.
(From OE-Core rev: 1133f3ab485031df6e107f826b7398e5133f9c4d)
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/npm.bbclass | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 799b2a3829..cf2c12047e 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
@@ -44,6 +44,9 @@ NPM_BUILD = "${WORKDIR}/npm-build" | |||
44 | def npm_global_configs(d): | 44 | def npm_global_configs(d): |
45 | """Get the npm global configuration""" | 45 | """Get the npm global configuration""" |
46 | configs = [] | 46 | configs = [] |
47 | # Ensure no network access is done | ||
48 | configs.append(("offline", "true")) | ||
49 | configs.append(("proxy", "http://invalid")) | ||
47 | # Configure the cache directory | 50 | # Configure the cache directory |
48 | configs.append(("cache", d.getVar("NPM_CACHE"))) | 51 | configs.append(("cache", d.getVar("NPM_CACHE"))) |
49 | return configs | 52 | return configs |