[elbe-devel] [PATCH 09/11] elbexml: Also save sha256 sums in fullpkgslist

Torben Hohn torben.hohn at linutronix.de
Mon Mar 14 14:48:24 CET 2022


Since buster, sha256 checksums in package indices are mandatory
and md5 sums are only optional.
On security.debian.org md5 sums are already dropped for bullseye.
This breaks the fullpackagelist validation.

Prepare to validate sha256 sums and save the sha256 sums into the
fullpkgslist.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/elbexml.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index 50be33346..d3f8fef91 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -399,11 +399,15 @@ class ElbeXML:
         pak.et.tail = '\n'
         if aptpkg.installed_version is not None:
             pak.et.set('version', aptpkg.installed_version)
-            pak.et.set('md5', aptpkg.installed_md5)
+            if aptpkg.installed_md5:
+                pak.et.set('md5', aptpkg.installed_md5)
+            pak.et.set('sha256', aptpkg.installed_sha256)
             pak.et.set('prio', aptpkg.installed_prio)
         else:
             pak.et.set('version', aptpkg.candidate_version)
-            pak.et.set('md5', aptpkg.candidate_md5)
+            if aptpkg.candidate_md5:
+                pak.et.set('md5', aptpkg.candidate_md5)
+            pak.et.set('sha256', aptpkg.candidate_sha256)
             pak.et.set('prio', aptpkg.candidate_prio)
 
         if aptpkg.is_auto_installed:
-- 
2.20.1



More information about the elbe-devel mailing list