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:33 +0000 |
commit | f59aa3752dbc5552469207894bea9c01bd68fb6e (patch) | |
tree | 268d944280d4602a716fe274ca2b4864194c9254 /bitbake | |
parent | c805f0f90a2d1b0de49978e6516a4e7f9b11aff4 (diff) | |
download | poky-f59aa3752dbc5552469207894bea9c01bd68fb6e.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: 28ba566c25af72afe62ea3cb62b0bafeffc47de8)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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 64a004d0d8..3ce98d3179 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1680,23 +1680,20 @@ def disable_network(uid=None, gid=None): | |||
1680 | 1680 | ||
1681 | def export_proxies(d): | 1681 | def export_proxies(d): |
1682 | """ export common proxies variables from datastore to environment """ | 1682 | """ export common proxies variables from datastore to environment """ |
1683 | import os | ||
1684 | 1683 | ||
1685 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', | 1684 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', |
1686 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', | 1685 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', |
1687 | 'GIT_PROXY_COMMAND'] | 1686 | 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR'] |
1688 | exported = False | ||
1689 | 1687 | ||
1690 | for v in variables: | 1688 | origenv = d.getVar("BB_ORIGENV") |
1691 | if v in os.environ.keys(): | 1689 | |
1692 | exported = True | 1690 | for name in variables: |
1693 | else: | 1691 | value = d.getVar(name) |
1694 | v_proxy = d.getVar(v) | 1692 | if not value and origenv: |
1695 | if v_proxy is not None: | 1693 | value = origenv.getVar(name) |
1696 | os.environ[v] = v_proxy | 1694 | if value: |
1697 | exported = True | 1695 | os.environ[name] = value |
1698 | 1696 | ||
1699 | return exported | ||
1700 | 1697 | ||
1701 | 1698 | ||
1702 | def load_plugins(logger, plugins, pluginpath): | 1699 | def load_plugins(logger, plugins, pluginpath): |