summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-01-26 16:49:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-26 21:50:31 +0000
commitb1ec98f71f196bce3042b6432d7767062529f547 (patch)
treed672caa0fcd15949d5678d997d7752034ab0444b /bitbake/lib/bb/utils.py
parent557aab215884d10839fa24f797890c99f38e97b2 (diff)
downloadpoky-b1ec98f71f196bce3042b6432d7767062529f547.tar.gz
bitbake: 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 ] (Bitbake rev: c19035e8e71c419c5688a86bfc9c946c96f638e8) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 8c79159573..4446997e42 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1699,23 +1699,20 @@ def disable_network(uid=None, gid=None):
1699 1699
1700def export_proxies(d): 1700def export_proxies(d):
1701 """ export common proxies variables from datastore to environment """ 1701 """ export common proxies variables from datastore to environment """
1702 import os
1703 1702
1704 variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', 1703 variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY',
1705 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', 1704 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY',
1706 'GIT_PROXY_COMMAND'] 1705 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR']
1707 exported = False
1708 1706
1709 for v in variables: 1707 origenv = d.getVar("BB_ORIGENV")
1710 if v in os.environ.keys(): 1708
1711 exported = True 1709 for name in variables:
1712 else: 1710 value = d.getVar(name)
1713 v_proxy = d.getVar(v) 1711 if not value and origenv:
1714 if v_proxy is not None: 1712 value = origenv.getVar(name)
1715 os.environ[v] = v_proxy 1713 if value:
1716 exported = True 1714 os.environ[name] = value
1717 1715
1718 return exported
1719 1716
1720 1717
1721def load_plugins(logger, plugins, pluginpath): 1718def load_plugins(logger, plugins, pluginpath):