diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index b41f53a9e2..2e92117634 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
| @@ -135,6 +135,15 @@ class Wget(FetchMethod): | |||
| 135 | 135 | ||
| 136 | self._runwget(ud, d, fetchcmd, False) | 136 | self._runwget(ud, d, fetchcmd, False) |
| 137 | 137 | ||
| 138 | # Sanity check since wget can pretend it succeed when it didn't | ||
| 139 | # Also, this used to happen if sourceforge sent us to the mirror page | ||
| 140 | if not os.path.exists(localpath): | ||
| 141 | raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, localpath), uri) | ||
| 142 | |||
| 143 | if os.path.getsize(localpath) == 0: | ||
| 144 | os.remove(localpath) | ||
| 145 | raise FetchError("The fetch of %s resulted in a zero size file?! Deleting and failing since this isn't right." % (uri), uri) | ||
| 146 | |||
| 138 | # Try and verify any checksum now, meaning if it isn't correct, we don't remove the | 147 | # Try and verify any checksum now, meaning if it isn't correct, we don't remove the |
| 139 | # original file, which might be a race (imagine two recipes referencing the same | 148 | # original file, which might be a race (imagine two recipes referencing the same |
| 140 | # source, one with an incorrect checksum) | 149 | # source, one with an incorrect checksum) |
| @@ -144,15 +153,6 @@ class Wget(FetchMethod): | |||
| 144 | # Our lock prevents multiple writers but mirroring code may grab incomplete files | 153 | # Our lock prevents multiple writers but mirroring code may grab incomplete files |
| 145 | os.rename(localpath, localpath[:-4]) | 154 | os.rename(localpath, localpath[:-4]) |
| 146 | 155 | ||
| 147 | # Sanity check since wget can pretend it succeed when it didn't | ||
| 148 | # Also, this used to happen if sourceforge sent us to the mirror page | ||
| 149 | if not os.path.exists(ud.localpath): | ||
| 150 | raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri) | ||
| 151 | |||
| 152 | if os.path.getsize(ud.localpath) == 0: | ||
| 153 | os.remove(ud.localpath) | ||
| 154 | raise FetchError("The fetch of %s resulted in a zero size file?! Deleting and failing since this isn't right." % (uri), uri) | ||
| 155 | |||
| 156 | return True | 156 | return True |
| 157 | 157 | ||
| 158 | def checkstatus(self, fetch, ud, d, try_again=True): | 158 | def checkstatus(self, fetch, ud, d, try_again=True): |
