diff options
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 9730b514e4..5af80f5c79 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -1406,3 +1406,22 @@ def set_process_name(name): | |||
1406 | libc.prctl(15, byref(buff), 0, 0, 0) | 1406 | libc.prctl(15, byref(buff), 0, 0, 0) |
1407 | except: | 1407 | except: |
1408 | pass | 1408 | pass |
1409 | |||
1410 | # export common proxies variables from datastore to environment | ||
1411 | def export_proxies(d): | ||
1412 | import os | ||
1413 | |||
1414 | variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', | ||
1415 | 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY'] | ||
1416 | exported = False | ||
1417 | |||
1418 | for v in variables: | ||
1419 | if v in os.environ.keys(): | ||
1420 | exported = True | ||
1421 | else: | ||
1422 | v_proxy = d.getVar(v, True) | ||
1423 | if v_proxy is not None: | ||
1424 | os.environ[v] = v_proxy | ||
1425 | exported = True | ||
1426 | |||
1427 | return exported | ||