diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 11 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index ac0f4dfa1d..3529531ca1 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -1115,7 +1115,8 @@ def try_mirror_url(fetch, origud, ud, ld, check = False): | |||
| 1115 | logger.debug("Mirror fetch failure for url %s (original url: %s)" % (ud.url, origud.url)) | 1115 | logger.debug("Mirror fetch failure for url %s (original url: %s)" % (ud.url, origud.url)) |
| 1116 | logger.debug(str(e)) | 1116 | logger.debug(str(e)) |
| 1117 | try: | 1117 | try: |
| 1118 | ud.method.clean(ud, ld) | 1118 | if ud.method.cleanup_upon_failure(): |
| 1119 | ud.method.clean(ud, ld) | ||
| 1119 | except UnboundLocalError: | 1120 | except UnboundLocalError: |
| 1120 | pass | 1121 | pass |
| 1121 | return False | 1122 | return False |
| @@ -1440,6 +1441,12 @@ class FetchMethod(object): | |||
| 1440 | """ | 1441 | """ |
| 1441 | return False | 1442 | return False |
| 1442 | 1443 | ||
| 1444 | def cleanup_upon_failure(self): | ||
| 1445 | """ | ||
| 1446 | When a fetch fails, should clean() be called? | ||
| 1447 | """ | ||
| 1448 | return True | ||
| 1449 | |||
| 1443 | def verify_donestamp(self, ud, d): | 1450 | def verify_donestamp(self, ud, d): |
| 1444 | """ | 1451 | """ |
| 1445 | Verify the donestamp file | 1452 | Verify the donestamp file |
| @@ -1885,7 +1892,7 @@ class Fetch(object): | |||
| 1885 | logger.debug(str(e)) | 1892 | logger.debug(str(e)) |
| 1886 | firsterr = e | 1893 | firsterr = e |
| 1887 | # Remove any incomplete fetch | 1894 | # Remove any incomplete fetch |
| 1888 | if not verified_stamp: | 1895 | if not verified_stamp and m.cleanup_upon_failure(): |
| 1889 | m.clean(ud, self.d) | 1896 | m.clean(ud, self.d) |
| 1890 | logger.debug("Trying MIRRORS") | 1897 | logger.debug("Trying MIRRORS") |
| 1891 | mirrors = mirror_from_string(self.d.getVar('MIRRORS')) | 1898 | mirrors = mirror_from_string(self.d.getVar('MIRRORS')) |
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index b43ee0da39..b9dc576d47 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
| @@ -150,6 +150,9 @@ class Git(FetchMethod): | |||
| 150 | def supports_checksum(self, urldata): | 150 | def supports_checksum(self, urldata): |
| 151 | return False | 151 | return False |
| 152 | 152 | ||
| 153 | def cleanup_upon_failure(self): | ||
| 154 | return False | ||
| 155 | |||
| 153 | def urldata_init(self, ud, d): | 156 | def urldata_init(self, ud, d): |
| 154 | """ | 157 | """ |
| 155 | init git specific variable within url data | 158 | init git specific variable within url data |
