public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] fetch2: avoid reuse download filenames
@ 2026-03-02 15:14 Pedro Ferreira
  2026-03-02 15:56 ` [bitbake-devel] " Richard Purdie
  2026-03-05  7:39 ` [bitbake-devel] " Mathieu Dubois-Briand
  0 siblings, 2 replies; 7+ messages in thread
From: Pedro Ferreira @ 2026-03-02 15:14 UTC (permalink / raw)
  To: bitbake-devel; +Cc: pmi183, Pedro Ferreira

When fetch task runs and while running checksum validation
detects that for a source file the checksum mismatches,
instead of aborting, its allowing to move aside and download again.
This might allow users to taint the source files instead of acting
as a safe mechanism to fix some issue occurred on the download stage.

Signed-off-by: Pedro Ferreira <Pedro.MS.Ferreira@ctw.mbwgroup.com>
---
 lib/bb/fetch2/__init__.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index dcf7adc26..b8d8957b0 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -716,13 +716,10 @@ def verify_donestamp(ud, d, origud=None):
                 p.dump(checksums)
         return True
     except ChecksumError as e:
-        # Checksums failed to verify, trigger re-download and remove the
-        # incorrect stamp file.
-        logger.warning("Checksum mismatch for local file %s\n"
-                       "Cleaning and trying again." % ud.localpath)
-        if os.path.exists(ud.localpath):
-            rename_bad_checksum(ud, e.checksum)
-        bb.utils.remove(ud.donestamp)
+        # If there is a checksum mismatch, it is likely because the file
+        # is being tainted or some corruption is occurring when downloading.
+        # Download cache should be cleaned up before trying again.
+        bb.fatal("Checksum mismatch for local file %s\n" % ud.localpath)
     return False
 
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-05 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 15:14 [PATCH] fetch2: avoid reuse download filenames Pedro Ferreira
2026-03-02 15:56 ` [bitbake-devel] " Richard Purdie
2026-03-02 16:54   ` pedro.ms.ferreira
2026-03-02 17:17     ` [bitbake-devel] " Yoann Congal
2026-03-05 10:22   ` pedro.ms.ferreira
2026-03-05  7:39 ` [bitbake-devel] " Mathieu Dubois-Briand
2026-03-05 15:21   ` pedro.ms.ferreira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox