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:40:24 +0000 |
commit | 251869992fc3e213cee4f9d6a9d3fe823b9892f0 (patch) | |
tree | ff79fbb5fed175d4fa210d89404675ebc40ce171 /bitbake/lib | |
parent | 65dafea22018052fe7b2e17e6e4d7eb754224d38 (diff) | |
download | poky-251869992fc3e213cee4f9d6a9d3fe823b9892f0.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: ed0dcc40f80c48839bac20298013d70043858a4e)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 92d44c5260..66a8a08c21 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1635,23 +1635,20 @@ def disable_network(uid=None, gid=None): | |||
1635 | 1635 | ||
1636 | def export_proxies(d): | 1636 | def export_proxies(d): |
1637 | """ export common proxies variables from datastore to environment """ | 1637 | """ export common proxies variables from datastore to environment """ |
1638 | import os | ||
1639 | 1638 | ||
1640 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', | 1639 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', |
1641 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', | 1640 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', |
1642 | 'GIT_PROXY_COMMAND'] | 1641 | 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR'] |
1643 | exported = False | ||
1644 | 1642 | ||
1645 | for v in variables: | 1643 | origenv = d.getVar("BB_ORIGENV") |
1646 | if v in os.environ.keys(): | 1644 | |
1647 | exported = True | 1645 | for name in variables: |
1648 | else: | 1646 | value = d.getVar(name) |
1649 | v_proxy = d.getVar(v) | 1647 | if not value and origenv: |
1650 | if v_proxy is not None: | 1648 | value = origenv.getVar(name) |
1651 | os.environ[v] = v_proxy | 1649 | if value: |
1652 | exported = True | 1650 | os.environ[name] = value |
1653 | 1651 | ||
1654 | return exported | ||
1655 | 1652 | ||
1656 | 1653 | ||
1657 | def load_plugins(logger, plugins, pluginpath): | 1654 | def load_plugins(logger, plugins, pluginpath): |