summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 07eb77dbfc..cd9410d04c 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__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)
@@ -517,7 +512,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
517 import sys 512 import sys
518 (type, value, traceback) = sys.exc_info() 513 (type, value, traceback) = sys.exc_info()
519 logger.debug(2, "Mirror fetch failure: %s", value) 514 logger.debug(2, "Mirror fetch failure: %s", value)
520 removefile(ud.localpath) 515 bb.utils.remove(ud.localpath)
521 continue 516 continue
522 return None 517 return None
523 518