diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2014-02-09 12:39:30 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:56:56 +0000 |
commit | 6d0f1d30d45ed28291d124682bd71eaa92ea79a2 (patch) | |
tree | 472aa360cd7c75125975fb3e281fe286606d473a /meta/lib/oeqa/utils | |
parent | 2bdc00fe74cc3f2b7daf43c9109e0727764b0a38 (diff) | |
download | poky-6d0f1d30d45ed28291d124682bd71eaa92ea79a2.tar.gz |
oeqa/utils: targetbuild: take proxy into account
A previous commit broke downloads
when proxies are involved, let's fix it.
(From OE-Core rev: 97e263b99cbe8184a74f80738fd471cfdef29e0c)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/targetbuild.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py index 77181b1c3d..32296762c0 100644 --- a/meta/lib/oeqa/utils/targetbuild.py +++ b/meta/lib/oeqa/utils/targetbuild.py | |||
@@ -11,8 +11,9 @@ import subprocess | |||
11 | 11 | ||
12 | class TargetBuildProject(): | 12 | class TargetBuildProject(): |
13 | 13 | ||
14 | def __init__(self, target, uri, foldername=None): | 14 | def __init__(self, target, d, uri, foldername=None): |
15 | self.target = target | 15 | self.target = target |
16 | self.d = d | ||
16 | self.uri = uri | 17 | self.uri = uri |
17 | self.targetdir = "~/" | 18 | self.targetdir = "~/" |
18 | self.archive = os.path.basename(uri) | 19 | self.archive = os.path.basename(uri) |
@@ -23,7 +24,22 @@ class TargetBuildProject(): | |||
23 | 24 | ||
24 | def download_archive(self): | 25 | def download_archive(self): |
25 | 26 | ||
26 | subprocess.check_call("wget -O %s %s" % (self.localarchive, self.uri), shell=True) | 27 | exportvars = ['HTTP_PROXY', 'http_proxy', |
28 | 'HTTPS_PROXY', 'https_proxy', | ||
29 | 'FTP_PROXY', 'ftp_proxy', | ||
30 | 'FTPS_PROXY', 'ftps_proxy', | ||
31 | 'NO_PROXY', 'no_proxy', | ||
32 | 'ALL_PROXY', 'all_proxy', | ||
33 | 'SOCKS5_USER', 'SOCKS5_PASSWD'] | ||
34 | |||
35 | cmd = '' | ||
36 | for var in exportvars: | ||
37 | val = self.d.getVar(var, True) | ||
38 | if val: | ||
39 | cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) | ||
40 | |||
41 | cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri) | ||
42 | subprocess.check_call(cmd, shell=True) | ||
27 | 43 | ||
28 | (status, output) = self.target.copy_to(self.localarchive, self.targetdir) | 44 | (status, output) = self.target.copy_to(self.localarchive, self.targetdir) |
29 | if status != 0: | 45 | if status != 0: |