diff options
| author | Scott Weaver <weaverjs@gmail.com> | 2021-05-25 08:37:02 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-06 23:18:26 +0100 |
| commit | cbb87447356578c439c2ac636bd619c868afad63 (patch) | |
| tree | 19143d4f4e637bd6c74df39f5c87437a65f449af /bitbake/lib/bb/fetch2 | |
| parent | be491f7343c7b384d791e4b4b1f6cb7bcbf9c2fb (diff) | |
| download | poky-cbb87447356578c439c2ac636bd619c868afad63.tar.gz | |
bitbake: fetch2: add check for empty SRC_URI hash string
No error was being reported when the hash string was set to empty.
For example: SRC_URI[md5sum] = ""
On a related note (not a bug):
Because whitespace in the string will result in a checksum mismatch, the error
message was updated to make it a little clearer why the error was thrown.
For example: SRC_URI[md5sum] = " " or
SRC_URI[md5sum] = " 209f8326f5137d8817a6276d9577a2f1"
Now creates a message like this:
File: '/home/scott/yocto-cache/downloads/rsync-3.2.3.tar.gz' has md5
checksum '209f8326f5137d8817a6276d9577a2f1' when ' 209f8326f5137d8817a6276d9577a2f1' was expected
[YOCTO #14232]
(Bitbake rev: a13510d0028e234ea2f4744b0d0c38558395c70f)
Signed-off-by: Scott Weaver <weaverjs@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 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index cf0201c490..c8e91262a9 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -562,6 +562,9 @@ def verify_checksum(ud, d, precomputed={}): | |||
| 562 | 562 | ||
| 563 | checksum_expected = getattr(ud, "%s_expected" % checksum_id) | 563 | checksum_expected = getattr(ud, "%s_expected" % checksum_id) |
| 564 | 564 | ||
| 565 | if checksum_expected == '': | ||
| 566 | checksum_expected = None | ||
| 567 | |||
| 565 | return { | 568 | return { |
| 566 | "id": checksum_id, | 569 | "id": checksum_id, |
| 567 | "name": checksum_name, | 570 | "name": checksum_name, |
| @@ -612,7 +615,7 @@ def verify_checksum(ud, d, precomputed={}): | |||
| 612 | 615 | ||
| 613 | for ci in checksum_infos: | 616 | for ci in checksum_infos: |
| 614 | if ci["expected"] and ci["expected"] != ci["data"]: | 617 | if ci["expected"] and ci["expected"] != ci["data"]: |
| 615 | messages.append("File: '%s' has %s checksum %s when %s was " \ | 618 | messages.append("File: '%s' has %s checksum '%s' when '%s' was " \ |
| 616 | "expected" % (ud.localpath, ci["id"], ci["data"], ci["expected"])) | 619 | "expected" % (ud.localpath, ci["id"], ci["data"], ci["expected"])) |
| 617 | bad_checksum = ci["data"] | 620 | bad_checksum = ci["data"] |
| 618 | 621 | ||
