summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2014-02-09 12:39:30 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-11 11:56:56 +0000
commit6d0f1d30d45ed28291d124682bd71eaa92ea79a2 (patch)
tree472aa360cd7c75125975fb3e281fe286606d473a
parent2bdc00fe74cc3f2b7daf43c9109e0727764b0a38 (diff)
downloadpoky-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>
-rw-r--r--meta/lib/oeqa/runtime/buildcvs.py2
-rw-r--r--meta/lib/oeqa/runtime/buildiptables.py2
-rw-r--r--meta/lib/oeqa/runtime/buildsudoku.py2
-rw-r--r--meta/lib/oeqa/utils/targetbuild.py20
4 files changed, 21 insertions, 5 deletions
diff --git a/meta/lib/oeqa/runtime/buildcvs.py b/meta/lib/oeqa/runtime/buildcvs.py
index 9bf764d00f..f1fbf19c1f 100644
--- a/meta/lib/oeqa/runtime/buildcvs.py
+++ b/meta/lib/oeqa/runtime/buildcvs.py
@@ -10,7 +10,7 @@ class BuildCvsTest(oeRuntimeTest):
10 10
11 @classmethod 11 @classmethod
12 def setUpClass(self): 12 def setUpClass(self):
13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, 13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
14 "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2") 14 "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
15 self.project.download_archive() 15 self.project.download_archive()
16 16
diff --git a/meta/lib/oeqa/runtime/buildiptables.py b/meta/lib/oeqa/runtime/buildiptables.py
index 50faf5d775..f6061a7f98 100644
--- a/meta/lib/oeqa/runtime/buildiptables.py
+++ b/meta/lib/oeqa/runtime/buildiptables.py
@@ -10,7 +10,7 @@ class BuildIptablesTest(oeRuntimeTest):
10 10
11 @classmethod 11 @classmethod
12 def setUpClass(self): 12 def setUpClass(self):
13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, 13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
14 "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2") 14 "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
15 self.project.download_archive() 15 self.project.download_archive()
16 16
diff --git a/meta/lib/oeqa/runtime/buildsudoku.py b/meta/lib/oeqa/runtime/buildsudoku.py
index 61dc1ff2dc..a754f1d9ea 100644
--- a/meta/lib/oeqa/runtime/buildsudoku.py
+++ b/meta/lib/oeqa/runtime/buildsudoku.py
@@ -10,7 +10,7 @@ class SudokuTest(oeRuntimeTest):
10 10
11 @classmethod 11 @classmethod
12 def setUpClass(self): 12 def setUpClass(self):
13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, 13 self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
14 "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2") 14 "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
15 self.project.download_archive() 15 self.project.download_archive()
16 16
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
12class TargetBuildProject(): 12class 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: