@@ -1841,11 +1841,14 @@ class Fetch(object):
"""
local = []
- for url in self.urls:
+ def localpath(url):
ud = self.ud[url]
ud.setup_localpath(self.d)
local.append(ud.localpath)
+ for url in self.urls:
+ localpath(url)
+
return local
def download(self, urls=None):
@@ -1859,7 +1862,7 @@ class Fetch(object):
premirroronly = bb.utils.to_boolean(self.d.getVar("BB_FETCH_PREMIRRORONLY"))
checksum_missing_messages = []
- for url in urls:
+ def download(url):
ud = self.ud[url]
ud.setup_localpath(self.d)
m = ud.method
@@ -1947,14 +1950,18 @@ class Fetch(object):
if isinstance(e, NoChecksumError):
(message, _) = e.args
checksum_missing_messages.append(message)
- continue
- elif isinstance(e, ChecksumError):
- logger.error("Checksum failure fetching %s" % url)
- raise
+ else:
+ if isinstance(e, ChecksumError):
+ logger.error("Checksum failure fetching %s" % url)
+ raise
finally:
if ud.lockfile:
bb.utils.unlockfile(lf)
+
+ for url in urls:
+ download(url)
+
if checksum_missing_messages:
logger.error("Missing SRC_URI checksum, please add those to the recipe: \n%s", "\n".join(checksum_missing_messages))
raise BBFetchException("There was some missing checksums in the recipe")
@@ -1971,7 +1978,7 @@ class Fetch(object):
if not urls:
urls = self.urls
- for url in urls:
+ def checkstatus(url):
ud = self.ud[url]
ud.setup_localpath(self.d)
m = ud.method
@@ -1990,6 +1997,9 @@ class Fetch(object):
if not ret:
raise FetchError("URL doesn't work", url)
+ for url in urls:
+ checkstatus(url)
+
def unpack(self, root, urls=None):
"""
Unpack urls to root
@@ -2000,7 +2010,7 @@ class Fetch(object):
unpack_tracer.start(root, self.ud, self.d)
- for url in urls:
+ def unpack(url):
ud = self.ud[url]
ud.setup_localpath(self.d)
@@ -2014,6 +2024,9 @@ class Fetch(object):
if ud.lockfile:
bb.utils.unlockfile(lf)
+ for url in urls:
+ unpack(url)
+
unpack_tracer.complete()
def clean(self, urls=None):
@@ -2024,14 +2037,14 @@ class Fetch(object):
if not urls:
urls = self.urls
- for url in urls:
+ def clean(url):
if url not in self.ud:
self.ud[url] = FetchData(url, self.d)
ud = self.ud[url]
ud.setup_localpath(self.d)
if not ud.localfile and ud.localpath is None:
- continue
+ return
if ud.lockfile:
lf = bb.utils.lockfile(ud.lockfile)
@@ -2043,6 +2056,9 @@ class Fetch(object):
if ud.lockfile:
bb.utils.unlockfile(lf)
+ for url in urls:
+ clean(url)
+
def expanded_urldata(self, urls=None):
"""
Get an expanded list of FetchData objects covering both the given
@@ -2054,10 +2070,13 @@ class Fetch(object):
urls = self.urls
urldata = []
- for url in urls:
+ def expand_urldata(url):
ud = self.ud[url]
urldata.append(ud)
- urldata += ud.method.implicit_urldata(ud, self.d)
+ urldata.extend(ud.method.implicit_urldata(ud, self.d))
+
+ for url in urls:
+ expand_urldata(url)
return urldata