diff options
author | Ross Burton <ross.burton@arm.com> | 2023-01-26 16:49:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-30 08:37:10 +0000 |
commit | ed0dcc40f80c48839bac20298013d70043858a4e (patch) | |
tree | ce8cd506e9f110bc4dca92dbfee30fa194f65908 /lib | |
parent | 7e268c107bb0240d583d2c34e24a71e373382509 (diff) | |
download | bitbake-contrib-ed0dcc40f80c48839bac20298013d70043858a4e.tar.gz |
bb/utils: include SSL certificate paths in export_proxies
bb.utils.export_proxies() is a poor-man's alternative for the
environment setup code in bb/fetch2, but it's used in several places
where recipes want to download manually (such as cve-update-db-native).
Notably, export_proxies() doesn't pass on the SSL certificate paths from
the original environment, so if SSL_CERT_FILE needs to be set (for
example, in a buildtools environment) then proxies work but SSL doesn't.
In an ideal world export_proxies and the same logic in fetch2 would
merge, but until then we can add the SSL_CERT_ variables and duplicate
the basic logic: check the datastore first and then the original
environment for variables.
Also remove the return value as nothing ever checked it.
[ YOCTO #15000 ]
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/utils.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 92d44c526..66a8a08c2 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -1635,23 +1635,20 @@ def disable_network(uid=None, gid=None): def export_proxies(d): """ export common proxies variables from datastore to environment """ - import os variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', - 'GIT_PROXY_COMMAND'] - exported = False + 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR'] - for v in variables: - if v in os.environ.keys(): - exported = True - else: - v_proxy = d.getVar(v) - if v_proxy is not None: - os.environ[v] = v_proxy - exported = True + origenv = d.getVar("BB_ORIGENV") + + for name in variables: + value = d.getVar(name) + if not value and origenv: + value = origenv.getVar(name) + if value: + os.environ[name] = value - return exported def load_plugins(logger, plugins, pluginpath): |