diff mbox series

[scarthgap,2.8,2/2] siggen: Fix rare file-checksum hash issue

Message ID 20241015114515.1331555-3-alban.bedel@aerq.com
State New
Headers show
Series Bug fixes backport | expand

Commit Message

Bedel, Alban Oct. 15, 2024, 11:45 a.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

There is a subtle issue with full pathnames being included in the
file checksums since the sorting might be different depending upon
how layers are being setup causing hash mismatches for recipes appeneded
from other layers with differing directory layouts.

Avoid this by filtering out to the path basename which is what is written
into the sig data anyway later in the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/siggen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 65ca0811d58b..8642e07f0fa0 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -904,7 +904,7 @@  def clean_checksum_file_path(file_checksum_tuple):
     f, cs = file_checksum_tuple
     if "/./" in f:
         return "./" + f.split("/./")[1]
-    return f
+    return os.path.basename(f)
 
 def dump_this_task(outfile, d):
     import bb.parse