mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
git.py: split download to download() and build_mirror_data()
the download is to fetch the source from URL, the build_mirror_data is to create the mirror tar ball. the original go() method mix them together, it is more clean to split them. Signed-off-by: Yu Ke <ke.yu@intel.com>
This commit is contained in:
@@ -294,6 +294,8 @@ def download(d, urls = None):
|
||||
# Next try fetching from the original uri, u
|
||||
try:
|
||||
m.download(u, ud, d)
|
||||
if hasattr(m, "build_mirror_data"):
|
||||
m.build_mirror_data(u, ud, d)
|
||||
localpath = ud.localpath
|
||||
except FetchError:
|
||||
# Remove any incomplete file
|
||||
@@ -500,6 +502,8 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
|
||||
return found
|
||||
else:
|
||||
ud.method.download(newuri, ud, ld)
|
||||
if hasattr(ud.method,"build_mirror_data"):
|
||||
ud.method.build_mirror_data(newuri, ud, ld)
|
||||
return ud.localpath
|
||||
except (bb.fetch2.MissingParameterError,
|
||||
bb.fetch2.FetchError,
|
||||
|
||||
Reference in New Issue
Block a user