diff options
author | Ross Burton <ross.burton@arm.com> | 2023-02-06 04:49:18 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-06 23:42:55 +0000 |
commit | 7d78d5f6e96eea26b98958a7b413f6c0743086b7 (patch) | |
tree | 2c9ebe0a23ee9d2e425c1366f9a66749345febc8 /bitbake | |
parent | 6b8a307b7843af23d189d7ffcecf32c05afac850 (diff) | |
download | poky-7d78d5f6e96eea26b98958a7b413f6c0743086b7.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.
[ YOCTO #15000 ]
(Bitbake rev: c16d364dbf68d2a500fecaf8d6e6d62b11475d9f)
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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/utils.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 826024661b..1a5a0aae6c 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1570,21 +1570,22 @@ def set_process_name(name): | |||
1570 | 1570 | ||
1571 | # export common proxies variables from datastore to environment | 1571 | # export common proxies variables from datastore to environment |
1572 | def export_proxies(d): | 1572 | def export_proxies(d): |
1573 | import os | 1573 | """ export common proxies variables from datastore to environment """ |
1574 | 1574 | ||
1575 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', | 1575 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', |
1576 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', | 1576 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY', |
1577 | 'GIT_PROXY_COMMAND'] | 1577 | 'GIT_PROXY_COMMAND', 'SSL_CERT_FILE', 'SSL_CERT_DIR'] |
1578 | exported = False | 1578 | exported = False |
1579 | 1579 | ||
1580 | for v in variables: | 1580 | origenv = d.getVar("BB_ORIGENV") |
1581 | if v in os.environ.keys(): | 1581 | |
1582 | for name in variables: | ||
1583 | value = d.getVar(name) | ||
1584 | if not value and origenv: | ||
1585 | value = origenv.getVar(name) | ||
1586 | if value: | ||
1587 | os.environ[name] = value | ||
1582 | exported = True | 1588 | exported = True |
1583 | else: | ||
1584 | v_proxy = d.getVar(v) | ||
1585 | if v_proxy is not None: | ||
1586 | os.environ[v] = v_proxy | ||
1587 | exported = True | ||
1588 | 1589 | ||
1589 | return exported | 1590 | return exported |
1590 | 1591 | ||