1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

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>
This commit is contained in:
Jean-Marie LEMETAYER
2020-01-24 18:07:32 +01:00
committed by Richard Purdie
parent de39f14d24
commit 8f39026f1a
+3
View File
@@ -44,6 +44,9 @@ NPM_BUILD = "${WORKDIR}/npm-build"
def npm_global_configs(d):
"""Get the npm global configuration"""
configs = []
# Ensure no network access is done
configs.append(("offline", "true"))
configs.append(("proxy", "http://invalid"))
# Configure the cache directory
configs.append(("cache", d.getVar("NPM_CACHE")))
return configs