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>
This commit is contained in:
parent
88a257634a
commit
40d7de8f06
|
@ -204,6 +204,7 @@ def fetcher_compare_revisons(d):
|
||||||
|
|
||||||
def init(urls, d, setup = True):
|
def init(urls, d, setup = True):
|
||||||
urldata = {}
|
urldata = {}
|
||||||
|
|
||||||
fn = bb.data.getVar('FILE', d, 1)
|
fn = bb.data.getVar('FILE', d, 1)
|
||||||
if fn in urldata_cache:
|
if fn in urldata_cache:
|
||||||
urldata = urldata_cache[fn]
|
urldata = urldata_cache[fn]
|
||||||
|
@ -400,7 +401,7 @@ def runfetchcmd(cmd, d, quiet = False):
|
||||||
for var in exportvars:
|
for var in exportvars:
|
||||||
val = data.getVar(var, d, True)
|
val = data.getVar(var, d, True)
|
||||||
if val:
|
if val:
|
||||||
cmd = 'export ' + var + '=%s; %s' % (val, cmd)
|
cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
|
||||||
|
|
||||||
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd)
|
bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s" % cmd)
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch import FetchError
|
||||||
from bb.fetch import encodeurl, decodeurl
|
from bb.fetch import encodeurl, decodeurl
|
||||||
|
from bb.fetch import runfetchcmd
|
||||||
|
|
||||||
class Wget(Fetch):
|
class Wget(Fetch):
|
||||||
"""Class to fetch urls via 'wget'"""
|
"""Class to fetch urls via 'wget'"""
|
||||||
|
@ -65,33 +66,12 @@ class Wget(Fetch):
|
||||||
uri_type = uri_decoded[0]
|
uri_type = uri_decoded[0]
|
||||||
uri_host = uri_decoded[1]
|
uri_host = uri_decoded[1]
|
||||||
|
|
||||||
bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
|
|
||||||
fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
|
fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
|
||||||
fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
|
fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
|
||||||
httpproxy = None
|
|
||||||
ftpproxy = None
|
bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
|
||||||
if uri_type == 'http':
|
|
||||||
httpproxy = data.getVar("HTTP_PROXY", d, True)
|
|
||||||
httpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split()
|
|
||||||
for p in httpproxy_ignore:
|
|
||||||
if uri_host.endswith(p):
|
|
||||||
httpproxy = None
|
|
||||||
break
|
|
||||||
if uri_type == 'ftp':
|
|
||||||
ftpproxy = data.getVar("FTP_PROXY", d, True)
|
|
||||||
ftpproxy_ignore = (data.getVar("HTTP_PROXY_IGNORE", d, True) or "").split()
|
|
||||||
for p in ftpproxy_ignore:
|
|
||||||
if uri_host.endswith(p):
|
|
||||||
ftpproxy = None
|
|
||||||
break
|
|
||||||
if httpproxy:
|
|
||||||
fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
|
|
||||||
if ftpproxy:
|
|
||||||
fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
|
|
||||||
bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd)
|
bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd)
|
||||||
ret = os.system(fetchcmd)
|
runfetchcmd(fetchcmd, d)
|
||||||
if ret != 0:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Sanity check since wget can pretend it succeed when it didn't
|
# Sanity check since wget can pretend it succeed when it didn't
|
||||||
# Also, this used to happen if sourceforge sent us to the mirror page
|
# Also, this used to happen if sourceforge sent us to the mirror page
|
||||||
|
|
Loading…
Reference in New Issue