diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-01-10 23:05:19 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-12 13:47:14 +0000 |
| commit | 2ef204dcdd28d60819ad7a413426b9676c54a3a4 (patch) | |
| tree | 64cefc01e17bedaea8501555277c9d4032e3ad6f /bitbake/lib/bb/fetch2 | |
| parent | c405a3a13eb961365adb788e710fa26513605543 (diff) | |
| download | poky-2ef204dcdd28d60819ad7a413426b9676c54a3a4.tar.gz | |
*: use utils.remove() some more
(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 11 |
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 | |||
| 31 | import bb | 31 | import bb |
| 32 | from bb import data | 32 | from bb import data |
| 33 | from bb import persist_data | 33 | from bb import persist_data |
| 34 | from bb import utils | ||
| 34 | 35 | ||
| 35 | logger = logging.getLogger("BitBake.Fetch") | 36 | logger = logging.getLogger("BitBake.Fetch") |
| 36 | 37 | ||
| @@ -217,12 +218,6 @@ def init(urls, d, setup = True): | |||
| 217 | def mirror_from_string(data): | 218 | def 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 | ||
| 220 | def removefile(f): | ||
| 221 | try: | ||
| 222 | os.remove(f) | ||
| 223 | except: | ||
| 224 | pass | ||
| 225 | |||
| 226 | def verify_checksum(u, ud, d): | 221 | def 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 | ||
