summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-04 18:26:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-07 11:03:00 +0100
commitc77bcfbfe36a7c780ed244c63daec4255f9d4343 (patch)
tree159e189a45ad27249cd20807b2f24620f950feb8 /bitbake
parent3d74d5eed9be82f0c99749a200f109e290b26b4d (diff)
downloadpoky-c77bcfbfe36a7c780ed244c63daec4255f9d4343.tar.gz
bitbake/fetch2/wget: Remove unneeded function indirection and reindent
(Bitbake rev: 769b92b14a1dfbbf697b8f4bf9a5a828807fd885) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py49
1 files changed, 23 insertions, 26 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 89bf57ba1f..9d361150e4 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -53,35 +53,32 @@ class Wget(FetchMethod):
53 def download(self, uri, ud, d, checkonly = False): 53 def download(self, uri, ud, d, checkonly = False):
54 """Fetch urls""" 54 """Fetch urls"""
55 55
56 def fetch_uri(uri, ud, d): 56 if checkonly:
57 if checkonly: 57 fetchcmd = data.getVar("CHECKCOMMAND_wget", d, True)
58 fetchcmd = data.getVar("CHECKCOMMAND_wget", d, True) 58 elif os.path.exists(ud.localpath):
59 elif os.path.exists(ud.localpath): 59 # file exists, but we didnt complete it.. trying again..
60 # file exists, but we didnt complete it.. trying again.. 60 fetchcmd = data.getVar("RESUMECOMMAND_wget", d, True)
61 fetchcmd = data.getVar("RESUMECOMMAND_wget", d, True) 61 else:
62 else: 62 fetchcmd = data.getVar("FETCHCOMMAND_wget", d, True)
63 fetchcmd = data.getVar("FETCHCOMMAND_wget", d, True)
64 63
65 uri = uri.split(";")[0] 64 uri = uri.split(";")[0]
66 uri_decoded = list(decodeurl(uri)) 65 uri_decoded = list(decodeurl(uri))
67 uri_type = uri_decoded[0] 66 uri_type = uri_decoded[0]
68 uri_host = uri_decoded[1] 67 uri_host = uri_decoded[1]
69 68
70 fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) 69 fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
71 fetchcmd = fetchcmd.replace("${FILE}", ud.basename) 70 fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
72 if not checkonly: 71 if not checkonly:
73 logger.info("fetch " + uri) 72 logger.info("fetch " + uri)
74 logger.debug(2, "executing " + fetchcmd) 73 logger.debug(2, "executing " + fetchcmd)
75 bb.fetch2.check_network_access(d, fetchcmd) 74 bb.fetch2.check_network_access(d, fetchcmd)
76 runfetchcmd(fetchcmd, d, quiet=checkonly) 75 runfetchcmd(fetchcmd, d, quiet=checkonly)
77 76
78 # Sanity check since wget can pretend it succeed when it didn't 77 # Sanity check since wget can pretend it succeed when it didn't
79 # Also, this used to happen if sourceforge sent us to the mirror page 78 # Also, this used to happen if sourceforge sent us to the mirror page
80 if not os.path.exists(ud.localpath) and not checkonly: 79 if not os.path.exists(ud.localpath) and not checkonly:
81 raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri) 80 raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri)
82 81
83 fetch_uri(uri, ud, localdata)
84
85 return True 82 return True
86 83
87 def checkstatus(self, uri, ud, d): 84 def checkstatus(self, uri, ud, d):