diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2010-12-21 00:52:10 +0000 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-12-21 00:52:10 +0000 |
| commit | 2d1007b33fcfc4b7f6bb84d2695e2111b995c763 (patch) | |
| tree | d00d34db20b9405a472f33acbaff7ea1745b2c40 /bitbake/lib | |
| parent | 52aada2eaf08d57d5f715f155f2d878831dbaab0 (diff) | |
| download | poky-2d1007b33fcfc4b7f6bb84d2695e2111b995c763.tar.gz | |
bitbake/fetch: Only checksum downloads when they're first downloaded and a checksum is present
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 88212ffa33..8c10df4ffe 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
| @@ -247,9 +247,6 @@ def verify_checksum(u, ud, d): | |||
| 247 | if not ud.type in ["http", "https", "ftp", "ftps"]: | 247 | if not ud.type in ["http", "https", "ftp", "ftps"]: |
| 248 | return | 248 | return |
| 249 | 249 | ||
| 250 | md5data = bb.utils.md5_file(ud.localpath) | ||
| 251 | sha256data = bb.utils.sha256_file(ud.localpath) | ||
| 252 | |||
| 253 | if (ud.md5_expected == None or ud.sha256_expected == None): | 250 | if (ud.md5_expected == None or ud.sha256_expected == None): |
| 254 | bb.warn("Missing SRC_URI checksum for %s, consider to add\n" \ | 251 | bb.warn("Missing SRC_URI checksum for %s, consider to add\n" \ |
| 255 | "SRC_URI[%s] = \"%s\"\nSRC_URI[%s] = \"%s\"" \ | 252 | "SRC_URI[%s] = \"%s\"\nSRC_URI[%s] = \"%s\"" \ |
| @@ -258,6 +255,9 @@ def verify_checksum(u, ud, d): | |||
| 258 | raise FetchError("No checksum specified for %s." % u) | 255 | raise FetchError("No checksum specified for %s." % u) |
| 259 | return | 256 | return |
| 260 | 257 | ||
| 258 | md5data = bb.utils.md5_file(ud.localpath) | ||
| 259 | sha256data = bb.utils.sha256_file(ud.localpath) | ||
| 260 | |||
| 261 | if (ud.md5_expected != md5data or ud.sha256_expected != sha256data): | 261 | if (ud.md5_expected != md5data or ud.sha256_expected != sha256data): |
| 262 | bb.error("The checksums for '%s' did not match." % ud.localpath) | 262 | bb.error("The checksums for '%s' did not match." % ud.localpath) |
| 263 | bb.error("Expected MD5: '%s' and Got: '%s'" % (ud.md5_expected, md5data)) | 263 | bb.error("Expected MD5: '%s' and Got: '%s'" % (ud.md5_expected, md5data)) |
| @@ -307,8 +307,6 @@ def go(d, urls = None): | |||
| 307 | 307 | ||
| 308 | ud.localpath = localpath | 308 | ud.localpath = localpath |
| 309 | 309 | ||
| 310 | verify_checksum(u, ud, d) | ||
| 311 | |||
| 312 | if os.path.exists(ud.md5): | 310 | if os.path.exists(ud.md5): |
| 313 | # Touch the md5 file to show active use of the download | 311 | # Touch the md5 file to show active use of the download |
| 314 | try: | 312 | try: |
| @@ -317,6 +315,8 @@ def go(d, urls = None): | |||
| 317 | # Errors aren't fatal here | 315 | # Errors aren't fatal here |
| 318 | pass | 316 | pass |
| 319 | else: | 317 | else: |
| 318 | # Only check the checksums if we've not seen this item before | ||
| 319 | verify_checksum(u, ud, d) | ||
| 320 | Fetch.write_md5sum(u, ud, d) | 320 | Fetch.write_md5sum(u, ud, d) |
| 321 | 321 | ||
| 322 | bb.utils.unlockfile(lf) | 322 | bb.utils.unlockfile(lf) |
