diff options
| author | Ryan Phillips <ryan_d_phillips@dell.com> | 2010-06-08 14:20:55 -0500 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:36 +0100 |
| commit | 40d7de8f06d789983ce060287f7517a440f1682c (patch) | |
| tree | 541c8b6d8983c51f4a9fe43b3dc7c0c7421f60ab /bitbake/lib/bb/fetch/wget.py | |
| parent | 88a257634a7a681d711e4401a7109d8742e9a166 (diff) | |
| download | poky-40d7de8f06d789983ce060287f7517a440f1682c.tar.gz | |
Change wget fetcher to use the runfetchcmd
* Fixes proxy support to honor standard proxy environment variables.
* Quote environment variables
(Bitbake rev: f84f382f340d6db15b9e5afb8c7c93969249a958)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/wget.py')
| -rw-r--r-- | bitbake/lib/bb/fetch/wget.py | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py index 581362038a..dcc58c75e8 100644 --- a/bitbake/lib/bb/fetch/wget.py +++ b/bitbake/lib/bb/fetch/wget.py | |||
| @@ -31,6 +31,7 @@ from bb import data | |||
| 31 | from bb.fetch import Fetch | 31 | from bb.fetch import Fetch |
| 32 | from bb.fetch import FetchError | 32 | from bb.fetch import FetchError |
| 33 | from bb.fetch import encodeurl, decodeurl | 33 | from bb.fetch import encodeurl, decodeurl |
| 34 | from bb.fetch import runfetchcmd | ||
| 34 | 35 | ||
| 35 | class Wget(Fetch): | 36 | class Wget(Fetch): |
| 36 | """Class to fetch urls via 'wget'""" | 37 | """Class to fetch urls via 'wget'""" |
| @@ -65,33 +66,12 @@ class Wget(Fetch): | |||
| 65 | uri_type = uri_decoded[0] | 66 | uri_type = uri_decoded[0] |
| 66 | uri_host = uri_decoded[1] | 67 | uri_host = uri_decoded[1] |
| 67 | 68 | ||
| 68 | bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) | ||
| 69 | fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) | 69 | fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) |
| 70 | fetchcmd = fetchcmd.replace("${FILE}", ud.basename) | 70 | fetchcmd = fetchcmd.replace("${FILE}", ud.basename) |
| 71 | httpproxy = None | 71 | |
| 72 | ftpproxy = None | 72 | bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) |
| 73 | if uri_type == 'http': | ||
| 74 | httpproxy = data.getVar("HTTP_PROXY", d, True) | ||
| 75 | httpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split() | ||
| 76 | for p in httpproxy_ignore: | ||
| 77 | if uri_host.endswith(p): | ||
| 78 | httpproxy = None | ||
| 79 | break | ||
| 80 | if uri_type == 'ftp': | ||
| 81 | ftpproxy = data.getVar("FTP_PROXY", d, True) | ||
| 82 | ftpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split() | ||
| 83 | for p in ftpproxy_ignore: | ||
| 84 | if uri_host.endswith(p): | ||
| 85 | ftpproxy = None | ||
| 86 | break | ||
| 87 | if httpproxy: | ||
| 88 | fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd | ||
| 89 | if ftpproxy: | ||
| 90 | fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd | ||
| 91 | bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd) | 73 | bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd) |
| 92 | ret = os.system(fetchcmd) | 74 | runfetchcmd(fetchcmd, d) |
| 93 | if ret != 0: | ||
| 94 | return False | ||
| 95 | 75 | ||
| 96 | # Sanity check since wget can pretend it succeed when it didn't | 76 | # Sanity check since wget can pretend it succeed when it didn't |
| 97 | # Also, this used to happen if sourceforge sent us to the mirror page | 77 | # Also, this used to happen if sourceforge sent us to the mirror page |
