]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Improve proxy variable handling in fetchers
authorRichard Purdie <rpurdie@rpsys.net>
Wed, 22 Oct 2008 21:24:03 +0000 (22:24 +0100)
committerRichard Purdie <rpurdie@rpsys.net>
Wed, 22 Oct 2008 21:24:03 +0000 (22:24 +0100)
bitbake-dev/lib/bb/fetch/__init__.py
bitbake-dev/lib/bb/fetch/wget.py
bitbake/lib/bb/fetch/__init__.py
bitbake/lib/bb/fetch/wget.py

index a4ede2b77feb72e15e93684c66089d9eeae7dff8..ab7a9bed92d9ca8badf4255562df27adc58d21e0 100644 (file)
@@ -465,6 +465,12 @@ class Fetch(object):
             uri = stash + tarfn
             bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
             fetchcmd = fetchcmd.replace("${URI}", uri)
+            httpproxy = data.getVar("http_proxy", d, True)
+            ftpproxy = data.getVar("ftp_proxy", d, True)
+            if httpproxy:
+                fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
+            if ftpproxy:
+                fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
             ret = os.system(fetchcmd)
             if ret == 0:
                 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn)
index 739d5a1bc6e2778e09d5630dc76301972188fb9b..c125ecb59bfe50276d1234002e6c1a5297b4f00f 100644 (file)
@@ -63,7 +63,14 @@ class Wget(Fetch):
             bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
             fetchcmd = fetchcmd.replace("${URI}", uri)
             fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
+            httpproxy = data.getVar("http_proxy", d, True)
+            ftpproxy = data.getVar("ftp_proxy", d, True)
+            if httpproxy:
+                fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
+            if ftpproxy:
+                fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
             bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd)
+            sys.exit(1)
             ret = os.system(fetchcmd)
             if ret != 0:
                 return False
index a4ede2b77feb72e15e93684c66089d9eeae7dff8..ab7a9bed92d9ca8badf4255562df27adc58d21e0 100644 (file)
@@ -465,6 +465,12 @@ class Fetch(object):
             uri = stash + tarfn
             bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
             fetchcmd = fetchcmd.replace("${URI}", uri)
+            httpproxy = data.getVar("http_proxy", d, True)
+            ftpproxy = data.getVar("ftp_proxy", d, True)
+            if httpproxy:
+                fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
+            if ftpproxy:
+                fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
             ret = os.system(fetchcmd)
             if ret == 0:
                 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn)
index 739d5a1bc6e2778e09d5630dc76301972188fb9b..c125ecb59bfe50276d1234002e6c1a5297b4f00f 100644 (file)
@@ -63,7 +63,14 @@ class Wget(Fetch):
             bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
             fetchcmd = fetchcmd.replace("${URI}", uri)
             fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
+            httpproxy = data.getVar("http_proxy", d, True)
+            ftpproxy = data.getVar("ftp_proxy", d, True)
+            if httpproxy:
+                fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
+            if ftpproxy:
+                fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
             bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd)
+            sys.exit(1)
             ret = os.system(fetchcmd)
             if ret != 0:
                 return False