[Git][qa/jenkins.debian.net][master] reproducible debian: sqla 2.0 execute() method more strict, execution options are more prominent

Mattia Rizzolo (@mattia) gitlab at salsa.debian.org
Mon Aug 11 15:15:42 BST 2025



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
4d1e1c92 by Mattia Rizzolo at 2025-08-11T16:15:29+02:00
reproducible debian: sqla 2.0 execute() method more strict, execution options are more prominent

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- bin/reproducible_html_packages.py


Changes:

=====================================
bin/reproducible_html_packages.py
=====================================
@@ -1,9 +1,11 @@
 #!/usr/bin/python3
 # -*- coding: utf-8 -*-
 #
-# Copyright © 2015-2018 Mattia Rizzolo <mattia at mapreri.org>
+# Copyright © 2015-2025 Mattia Rizzolo <mattia at mapreri.org>
 # Copyright © 2016-2017 Valerie R Young <spectranaut at riseup.net>
-# Based on reproducible_html_packages.sh © 2014 Holger Levsen <holger at layer-acht.org>
+#
+# Based on reproducible_html_packages.sh
+# © 2014 Holger Levsen <holger at layer-acht.org>
 # Licensed under GPL-2
 #
 # Depends: python3
@@ -16,7 +18,6 @@ import urllib
 import pystache
 import apt_pkg
 import sqlalchemy
-apt_pkg.init_system()
 
 from rblib import query_db
 from rblib.confparse import log, args
@@ -35,13 +36,14 @@ from rblib.const import (
     DBDTXT_PATH, DBDTXT_URI,
     DBDJSON_PATH, DBDJSON_URI,
     DBD_PATH, DBD_URI,
-#    DIFFS_PATH, DIFFS_URI,
-#    LOGS_PATH, LOGS_URI,
+    # DIFFS_PATH, DIFFS_URI,
+    # LOGS_PATH, LOGS_URI,
 )
 
+apt_pkg.init_system()
 
 # Templates used for creating package pages
-renderer = pystache.Renderer();
+renderer = pystache.Renderer()
 package_page_template = renderer.load_template(
     os.path.join(TEMPLATE_PATH, 'package_page'))
 package_navigation_template = renderer.load_template(
@@ -57,7 +59,7 @@ package_history_template = renderer.load_template(
 
 
 def sizeof_fmt(num):
-    for unit in ['B','KB','MB','GB']:
+    for unit in ['B', 'KB', 'MB', 'GB']:
         if abs(num) < 1024.0:
             if unit == 'GB':
                 log.error('The size of this file is bigger than 1 GB!')
@@ -454,7 +456,7 @@ def gen_all_rb_pkg_pages(no_clean=False):
         'FROM sources s JOIN distributions d ON d.id=s.distribution '
         'WHERE d.name=:d AND s.suite = ANY(:s)'
     )
-    rows = query_db(sqlalchemy.text(query), d=DISTRO, s=SUITES)
+    rows = query_db(sqlalchemy.text(query), {"d": DISTRO, "s": SUITES})
     pkgs = [Package(str(i[0]), no_notes=True) for i in rows]
     log.info('Processing all %s package from all suites/architectures',
              len(pkgs))
@@ -481,7 +483,9 @@ def purge_old_suite_arch_pages(suite, arch):
     )
     cur_pkgs = set([
         (p.name, p.suite, p.architecture) for p in query_db(
-            sqlalchemy.text(query), suite=suite, arch=arch, dist=DISTRO)
+            sqlalchemy.text(query),
+            {"suite": suite, "arch": arch, "dist": DISTRO
+        })
     ])
 
     for page in presents:



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/4d1e1c92d0577da26fd959f92f33c399b253b83a

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/4d1e1c92d0577da26fd959f92f33c399b253b83a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20250811/84ffc3b6/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list