summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 89f5930b7f..bfc0e2832f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -843,19 +843,21 @@ class Fetch(object):
843 os.symlink(mirrorpath, os.path.join(self.d.getVar("DL_DIR", True), os.path.basename(mirrorpath))) 843 os.symlink(mirrorpath, os.path.join(self.d.getVar("DL_DIR", True), os.path.basename(mirrorpath)))
844 844
845 if bb.data.getVar("BB_FETCH_PREMIRRORONLY", self.d, True) is None: 845 if bb.data.getVar("BB_FETCH_PREMIRRORONLY", self.d, True) is None:
846 if not localpath and m.need_update(u, ud, self.d): 846 bb.data.setVar("BB_NO_NETWORK", "1", self.d)
847 try: 847
848 m.download(u, ud, self.d) 848 if not localpath and m.need_update(u, ud, self.d):
849 if hasattr(m, "build_mirror_data"): 849 try:
850 m.build_mirror_data(u, ud, self.d) 850 m.download(u, ud, self.d)
851 localpath = ud.localpath 851 if hasattr(m, "build_mirror_data"):
852 852 m.build_mirror_data(u, ud, self.d)
853 except BBFetchException: 853 localpath = ud.localpath
854 # Remove any incomplete fetch 854
855 if os.path.isfile(ud.localpath): 855 except BBFetchException:
856 bb.utils.remove(ud.localpath) 856 # Remove any incomplete fetch
857 mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True)) 857 if os.path.isfile(ud.localpath):
858 localpath = try_mirrors (self.d, ud, mirrors) 858 bb.utils.remove(ud.localpath)
859 mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
860 localpath = try_mirrors (self.d, ud, mirrors)
859 861
860 if not localpath or not os.path.exists(localpath): 862 if not localpath or not os.path.exists(localpath):
861 raise FetchError("Unable to fetch URL %s from any source." % u, u) 863 raise FetchError("Unable to fetch URL %s from any source." % u, u)