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__.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 751e514121..2aeb8b8fe1 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -31,6 +31,7 @@ import logging
31import bb 31import bb
32from bb import data 32from bb import data
33from bb import persist_data 33from bb import persist_data
34from bb import utils
34 35
35logger = logging.getLogger("BitBake.Fetch") 36logger = logging.getLogger("BitBake.Fetch")
36 37
@@ -217,12 +218,6 @@ def init(urls, d, setup = True):
217def mirror_from_string(data): 218def mirror_from_string(data):
218 return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ] 219 return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ]
219 220
220def removefile(f):
221 try:
222 os.remove(f)
223 except:
224 pass
225
226def verify_checksum(u, ud, d): 221def verify_checksum(u, ud, d):
227 """ 222 """
228 verify the MD5 and SHA256 checksum for downloaded src 223 verify the MD5 and SHA256 checksum for downloaded src
@@ -293,7 +288,7 @@ def go(d, urls = None):
293 localpath = ud.localpath 288 localpath = ud.localpath
294 except FetchError: 289 except FetchError:
295 # Remove any incomplete file 290 # Remove any incomplete file
296 removefile(ud.localpath) 291 bb.utils.remove(ud.localpath)
297 # Finally, try fetching uri, u, from MIRRORS 292 # Finally, try fetching uri, u, from MIRRORS
298 mirrors = mirror_from_string(bb.data.getVar('MIRRORS', d, True)) 293 mirrors = mirror_from_string(bb.data.getVar('MIRRORS', d, True))
299 localpath = try_mirrors (d, u, mirrors) 294 localpath = try_mirrors (d, u, mirrors)
@@ -503,7 +498,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
503 import sys 498 import sys
504 (type, value, traceback) = sys.exc_info() 499 (type, value, traceback) = sys.exc_info()
505 logger.debug(2, "Mirror fetch failure: %s", value) 500 logger.debug(2, "Mirror fetch failure: %s", value)
506 removefile(ud.localpath) 501 bb.utils.remove(ud.localpath)
507 continue 502 continue
508 return None 503 return None
509 504