1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-02-04 10:26:21 +00:00
parent f6eefb3ca3
commit d08397ba4d
11 changed files with 118 additions and 142 deletions
+4 -9
View File
@@ -72,20 +72,15 @@ class Wget(Fetch):
# 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
if not os.path.exists(ud.localpath) and not checkonly:
logger.debug(2, "The fetch command for %s returned success but %s doesn't exist?...", uri, ud.localpath)
return False
return True
raise FetchError("The fetch command returned success but %s doesn't exist?!" % (uri, ud.localpath), uri)
localdata = data.createCopy(d)
data.setVar('OVERRIDES', "wget:" + data.getVar('OVERRIDES', localdata), localdata)
data.update_data(localdata)
if fetch_uri(uri, ud, localdata):
return True
raise FetchError(uri)
fetch_uri(uri, ud, localdata)
return True
def checkstatus(self, uri, ud, d):
return self.download(uri, ud, d, True)