Skip to contentSkip to conversation

[1.46][PATCH 0/1] Patch review

bitbake Steve Sakoman 2 participants 3 messages Mar 30, 2022

lore
Share & tools
lore
#0 lore raw

Passed a-full on autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3445

The following changes since commit 41bf1fa85a540232dcf92fe473c3b3c4cd7259dd:

tinfoil: Allow run_command not to wait on events (2022-03-28 13:30:40 +0100)

are available in the Git repository at:

git://git.openembedded.org/bitbake-contrib stable/1.46-nut
http://cgit.openembedded.org/bitbake-contrib/log/?h=stable/1.46-nut

Scott Weaver (1):
fetch2: add check for empty SRC_URI hash string

 lib/bb/fetch2/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#1 lore raw

[bitbake][dunfell][1.46][PATCH 1/1] fetch2: add check for empty SRC_URI hash string

From: Scott Weaver <[email protected]>

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]

(cherry picked from commit a13510d0028e234ea2f4744b0d0c38558395c70f)
---
 lib/bb/fetch2/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/__init__.py +4 -1
index dc99914c..3e6555bd 100644
@@ -562,6 +562,9 @@ def verify_checksum(ud, d, precomputed={}):
 
         checksum_expected = getattr(ud, "%s_expected" % checksum_id)
 
+        if checksum_expected == '':
+            checksum_expected = None
+
         return {
             "id": checksum_id,
             "name": checksum_name,
@@ -612,7 +615,7 @@ def verify_checksum(ud, d, precomputed={}):
 
     for ci in checksum_infos:
         if ci["expected"] and ci["expected"] != ci["data"]:
-            messages.append("File: '%s' has %s checksum %s when %s was " \
+            messages.append("File: '%s' has %s checksum '%s' when '%s' was " \
                             "expected" % (ud.localpath, ci["id"], ci["data"], ci["expected"]))
             bad_checksum = ci["data"]
 
Signature · 1 line
2.25.1
Acked-by
#2 lore raw

Re: [bitbake-devel] [bitbake][dunfell][1.46][PATCH 1/1] fetch2: add check for empty SRC_URI hash string

Hi Steve,

Thanks for that, this will improve some errors reporting on the fetch.

Jose

Steve Sakoman <[email protected]> escreveu no dia quarta, 30/03/2022 à(s) 17:39:

Quoted 67 lines

From: Scott Weaver <[email protected]>

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]

(cherry picked from commit a13510d0028e234ea2f4744b0d0c38558395c70f)
---
 lib/bb/fetch2/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/__init__.py +4 -1
index dc99914c..3e6555bd 100644
@@ -562,6 +562,9 @@ def verify_checksum(ud, d, precomputed={}):
 
         checksum_expected = getattr(ud, "%s_expected" % checksum_id)
 
+        if checksum_expected == '':
+            checksum_expected = None
+
         return {
             "id": checksum_id,
             "name": checksum_name,
@@ -612,7 +615,7 @@ def verify_checksum(ud, d, precomputed={}):
 
     for ci in checksum_infos:
         if ci["expected"] and ci["expected"] != ci["data"]:
-            messages.append("File: '%s' has %s checksum %s when %s was " \
+            messages.append("File: '%s' has %s checksum '%s' when '%s'
 was " \
                             "expected" % (ud.localpath, ci["id"],
 ci["data"], ci["expected"]))

bad_checksum = ci["data"]

--
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#13552):
https://lists.openembedded.org/g/bitbake-devel/message/13552
Mute This Topic: https://lists.openembedded.org/mt/90135601/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma