attached
>From dad01d11ce8390f1c32fa39963d6aeb17897a9c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= <vi...@viric.name>
Date: Thu, 27 Feb 2025 14:16:41 +0100
Subject: [PATCH] Take latest of archive and file mtime
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Distributions like Yocto update the RPMs but they set all files inside to
a fixed timestamp, so that internal timestamp doesn't tell if files
changed.

Signed-off-by: Lluís Batlle i Rossell <vi...@viric.name>
---
 debuginfod/debuginfod.cxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 0edd57cb..4a65e57d 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -4725,7 +4725,9 @@ archive_classify (const string& rps, string& 
archive_extension, int64_t archivei
                   .bind(2, fileid)
                   .bind(3, seekable_size)
                   .bind(4, seekable_offset)
-                  .bind(5, seekable_mtime)
+                  // Distros like yocto reset timestamp in archives
+                  // Pick the most recent mtime, archive vs entry
+                  .bind(5, seekable_mtime > mtime ? seekable_mtime : mtime)
                   .step_ok_done();
             }
           else // potential source - sdef record
-- 
2.47.0

Reply via email to