mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 00:49:33 +02:00
bitbake/fetch2/wget: Remove unneeded function indirection and reindent
(Bitbake rev: 769b92b14a1dfbbf697b8f4bf9a5a828807fd885) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -53,35 +53,32 @@ class Wget(FetchMethod):
|
|||||||
def download(self, uri, ud, d, checkonly = False):
|
def download(self, uri, ud, d, checkonly = False):
|
||||||
"""Fetch urls"""
|
"""Fetch urls"""
|
||||||
|
|
||||||
def fetch_uri(uri, ud, d):
|
if checkonly:
|
||||||
if checkonly:
|
fetchcmd = data.getVar("CHECKCOMMAND_wget", d, True)
|
||||||
fetchcmd = data.getVar("CHECKCOMMAND_wget", d, True)
|
elif os.path.exists(ud.localpath):
|
||||||
elif os.path.exists(ud.localpath):
|
# file exists, but we didnt complete it.. trying again..
|
||||||
# file exists, but we didnt complete it.. trying again..
|
fetchcmd = data.getVar("RESUMECOMMAND_wget", d, True)
|
||||||
fetchcmd = data.getVar("RESUMECOMMAND_wget", d, True)
|
else:
|
||||||
else:
|
fetchcmd = data.getVar("FETCHCOMMAND_wget", d, True)
|
||||||
fetchcmd = data.getVar("FETCHCOMMAND_wget", d, True)
|
|
||||||
|
|
||||||
uri = uri.split(";")[0]
|
uri = uri.split(";")[0]
|
||||||
uri_decoded = list(decodeurl(uri))
|
uri_decoded = list(decodeurl(uri))
|
||||||
uri_type = uri_decoded[0]
|
uri_type = uri_decoded[0]
|
||||||
uri_host = uri_decoded[1]
|
uri_host = uri_decoded[1]
|
||||||
|
|
||||||
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)
|
||||||
if not checkonly:
|
if not checkonly:
|
||||||
logger.info("fetch " + uri)
|
logger.info("fetch " + uri)
|
||||||
logger.debug(2, "executing " + fetchcmd)
|
logger.debug(2, "executing " + fetchcmd)
|
||||||
bb.fetch2.check_network_access(d, fetchcmd)
|
bb.fetch2.check_network_access(d, fetchcmd)
|
||||||
runfetchcmd(fetchcmd, d, quiet=checkonly)
|
runfetchcmd(fetchcmd, d, quiet=checkonly)
|
||||||
|
|
||||||
# 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
|
||||||
if not os.path.exists(ud.localpath) and not checkonly:
|
if not os.path.exists(ud.localpath) and not checkonly:
|
||||||
raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri)
|
raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri)
|
||||||
|
|
||||||
fetch_uri(uri, ud, localdata)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def checkstatus(self, uri, ud, d):
|
def checkstatus(self, uri, ud, d):
|
||||||
|
|||||||
Reference in New Issue
Block a user