summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-08-10 17:55:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-12 06:28:01 +0100
commit348384135272ae7c62a11eeabcc43eddc957811f (patch)
treeeba2be5f24ff08fc24ebc47dafe8b7db0392d0cf /bitbake/lib/bb/fetch2/__init__.py
parent62098f90411ca6775d3d7d70a8a641ce35dc9f84 (diff)
downloadpoky-348384135272ae7c62a11eeabcc43eddc957811f.tar.gz
bitbake: fetch2: expose environment variable names that need to be exported
There is a list of environment variable names that need to be exported when executing external commands, such as 'http_proxy'. To avoid duplication, make this a top-level variable. Also add SSL_CERT_FILE, which is used by OpenSSL to locate the certificate bundle. This is needed in buildtools environments where the default path isn't valid. (Bitbake rev: 5c2cf57fd11d91f749a3b562f6f0a863f15013ed) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py46
1 files changed, 24 insertions, 22 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index ad898680ff..914fa5c024 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -808,6 +808,29 @@ def localpath(url, d):
808 fetcher = bb.fetch2.Fetch([url], d) 808 fetcher = bb.fetch2.Fetch([url], d)
809 return fetcher.localpath(url) 809 return fetcher.localpath(url)
810 810
811# Need to export PATH as binary could be in metadata paths
812# rather than host provided
813# Also include some other variables.
814FETCH_EXPORT_VARS = ['HOME', 'PATH',
815 'HTTP_PROXY', 'http_proxy',
816 'HTTPS_PROXY', 'https_proxy',
817 'FTP_PROXY', 'ftp_proxy',
818 'FTPS_PROXY', 'ftps_proxy',
819 'NO_PROXY', 'no_proxy',
820 'ALL_PROXY', 'all_proxy',
821 'GIT_PROXY_COMMAND',
822 'GIT_SSH',
823 'GIT_SSL_CAINFO',
824 'GIT_SMART_HTTP',
825 'SSH_AUTH_SOCK', 'SSH_AGENT_PID',
826 'SOCKS5_USER', 'SOCKS5_PASSWD',
827 'DBUS_SESSION_BUS_ADDRESS',
828 'P4CONFIG',
829 'SSL_CERT_FILE',
830 'AWS_ACCESS_KEY_ID',
831 'AWS_SECRET_ACCESS_KEY',
832 'AWS_DEFAULT_REGION']
833
811def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None): 834def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
812 """ 835 """
813 Run cmd returning the command output 836 Run cmd returning the command output
@@ -816,28 +839,7 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
816 Optionally remove the files/directories listed in cleanup upon failure 839 Optionally remove the files/directories listed in cleanup upon failure
817 """ 840 """
818 841
819 # Need to export PATH as binary could be in metadata paths 842 exportvars = FETCH_EXPORT_VARS
820 # rather than host provided
821 # Also include some other variables.
822 # FIXME: Should really include all export varaiables?
823 exportvars = ['HOME', 'PATH',
824 'HTTP_PROXY', 'http_proxy',
825 'HTTPS_PROXY', 'https_proxy',
826 'FTP_PROXY', 'ftp_proxy',
827 'FTPS_PROXY', 'ftps_proxy',
828 'NO_PROXY', 'no_proxy',
829 'ALL_PROXY', 'all_proxy',
830 'GIT_PROXY_COMMAND',
831 'GIT_SSH',
832 'GIT_SSL_CAINFO',
833 'GIT_SMART_HTTP',
834 'SSH_AUTH_SOCK', 'SSH_AGENT_PID',
835 'SOCKS5_USER', 'SOCKS5_PASSWD',
836 'DBUS_SESSION_BUS_ADDRESS',
837 'P4CONFIG',
838 'AWS_ACCESS_KEY_ID',
839 'AWS_SECRET_ACCESS_KEY',
840 'AWS_DEFAULT_REGION']
841 843
842 if not cleanup: 844 if not cleanup:
843 cleanup = [] 845 cleanup = []