diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 5a00287586..89f5930b7f 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -431,7 +431,8 @@ def try_mirrors(d, origud, mirrors, check = False): | |||
| 431 | 431 | ||
| 432 | except bb.fetch2.BBFetchException: | 432 | except bb.fetch2.BBFetchException: |
| 433 | logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url)) | 433 | logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url)) |
| 434 | bb.utils.remove(ud.localpath) | 434 | if os.path.isfile(ud.localpath): |
| 435 | bb.utils.remove(ud.localpath) | ||
| 435 | continue | 436 | continue |
| 436 | return None | 437 | return None |
| 437 | 438 | ||
| @@ -850,8 +851,9 @@ class Fetch(object): | |||
| 850 | localpath = ud.localpath | 851 | localpath = ud.localpath |
| 851 | 852 | ||
| 852 | except BBFetchException: | 853 | except BBFetchException: |
| 853 | # Remove any incomplete file | 854 | # Remove any incomplete fetch |
| 854 | bb.utils.remove(ud.localpath) | 855 | if os.path.isfile(ud.localpath): |
| 856 | bb.utils.remove(ud.localpath) | ||
| 855 | mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True)) | 857 | mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True)) |
| 856 | localpath = try_mirrors (self.d, ud, mirrors) | 858 | localpath = try_mirrors (self.d, ud, mirrors) |
| 857 | 859 | ||
