[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: reproducible debian: prefer yaml safe_load() to the unsafe variant

Mattia Rizzolo (@mattia) gitlab at salsa.debian.org
Sat Aug 21 16:07:32 BST 2021



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


Commits:
cb6c7a43 by Mattia Rizzolo at 2021-08-21T17:06:29+02:00
reproducible debian: prefer yaml safe_load() to the unsafe variant

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

- - - - -
aa216ae1 by Mattia Rizzolo at 2021-08-21T17:06:34+02:00
reproducible debian: adapt to the new python-popcon API

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

- - - - -


1 changed file:

- bin/reproducible_html_notes.py


Changes:

=====================================
bin/reproducible_html_notes.py
=====================================
@@ -1,7 +1,7 @@
 #!/usr/bin/python3
 # -*- coding: utf-8 -*-
 #
-# Copyright © 2015-2018 Mattia Rizzolo <mattia at mapreri.org>
+# Copyright © 2015-2021 Mattia Rizzolo <mattia at mapreri.org>
 # Copyright © 2015 Holger Levsen <holger at layer-acht.org>
 # Based on reproducible_html_notes.sh © 2014 Holger Levsen <holger at layer-acht.org>
 # Licensed under GPL-2
@@ -178,7 +178,7 @@ def load_notes():
     { 'package_name': {'version': '0.0', 'comments'<etc>}, 'package_name':{} }
     """
     with open(NOTES) as fd:
-        possible_notes = yaml.load(fd)
+        possible_notes = yaml.safe_load(fd)
     log.debug("notes loaded. There are " + str(len(possible_notes)) +
                   " package listed")
     notes = copy.copy(possible_notes)
@@ -204,7 +204,7 @@ def load_issues():
     { 'issue_name': {'description': 'blabla', 'url': 'blabla'} }
     """
     with open(ISSUES) as fd:
-        issues = yaml.load(fd)
+        issues = yaml.safe_load(fd)
     log.debug("issues loaded. There are " + str(len(issues)) +
                   " issues listed")
     return issues
@@ -440,7 +440,7 @@ def issues_popcon_annotate(issues_list):
     try:
         n = len(issues_list)
         popcon_dict = dict((p, 0) for p in issues_list)
-        popcon_dict.update(popcon.source_package(*issues_list))
+        popcon_dict.update(popcon.source_packages(issues_list))
         issues = sorted(popcon_dict.items(), key=lambda p: p[0])
         issues_by_popcon = sorted(issues, key=lambda p: p[1], reverse=True)
         issues_with_popcon = [(p[0], p[1], i<n/4) for i, p in enumerate(issues_by_popcon)]
@@ -508,9 +508,9 @@ if __name__ == '__main__':
     try:
         index_issues(issues, OrderedDict([
             ("Sum of packages' popcon scores",
-             lambda l: sum(popcon.source_package(*l).values())),
+             lambda l: sum(popcon.source_packages(l).values())),
             ("Sum of square-roots of packages' popcon scores",
-             lambda l: int(sum(map(sqrt, popcon.source_package(*l).values())))),
+             lambda l: int(sum(map(sqrt, popcon.source_packages(l).values())))),
             ("Number of packages",
              len),
         ]))



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/e286e1773a41f64656b2936ae1354e58376bad9e...aa216ae15c88d72be6061055cd4e2767c9644b39

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/e286e1773a41f64656b2936ae1354e58376bad9e...aa216ae15c88d72be6061055cd4e2767c9644b39
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/20210821/a67e4f75/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list