summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-02-06 04:49:18 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-06 23:42:50 +0000
commitc16d364dbf68d2a500fecaf8d6e6d62b11475d9f (patch)
treea540a3c89610dd3461a70a942ad76ec3864488b9
parente3db9c2e9eded3c5cb6040714a6054b44f6b3880 (diff)
downloadbitbake-yocto-3.1.23.tar.gz
bb/utils: include SSL certificate paths in export_proxiesyocto-3.1.232020-04.23-dunfell1.46.23
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. [ YOCTO #15000 ] Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c19035e8e71c419c5688a86bfc9c946c96f638e8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/utils.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 826024661..1a5a0aae6 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -1570,21 +1570,22 @@ def set_process_name(name):
# export common proxies variables from datastore to environment
def export_proxies(d):
- import os
+ """ export common proxies variables from datastore to environment """
variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY',
'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY',
- 'GIT_PROXY_COMMAND']
+ 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR']
exported = False
- for v in variables:
- if v in os.environ.keys():
+ 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
exported = True
- else:
- v_proxy = d.getVar(v)
- if v_proxy is not None:
- os.environ[v] = v_proxy
- exported = True
return exported