[Git][reproducible-builds/diffoscope][master] 2 commits: Support signed .buildinfo files again -- file(1) reports them as "PGP signed message".
Chris Lamb
gitlab at salsa.debian.org
Fri May 7 09:39:03 UTC 2021
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
698bb26a by Chris Lamb at 2021-05-07T10:38:06+01:00
Support signed .buildinfo files again -- file(1) reports them as "PGP signed message".
- - - - -
931bf77b by Chris Lamb at 2021-05-07T10:38:06+01:00
Check that we are parsing an actual Debian .buildinfo file, not just a file with that extension. (Closes: reproducible-builds/diffoscope#254, Debian:#987994)
- - - - -
1 changed file:
- diffoscope/comparators/debian.py
Changes:
=====================================
diffoscope/comparators/debian.py
=====================================
@@ -2,7 +2,7 @@
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2014-2015 Jérémy Bobbio <lunar at debian.org>
-# Copyright © 2015-2020 Chris Lamb <lamby at debian.org>
+# Copyright © 2015-2021 Chris Lamb <lamby at debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -299,7 +299,9 @@ class DotBuildinfoFile(DebControlFile):
DESCRIPTION = "Debian .buildinfo files"
CONTAINER_CLASSES = [DotBuildinfoContainer]
FILE_EXTENSION_SUFFIX = {".buildinfo"}
- FILE_TYPE_RE = re.compile(r"^(ASCII text|UTF-8 Unicode text)")
+ FILE_TYPE_RE = re.compile(
+ r"^(ASCII text|UTF-8 Unicode text|PGP signed message)"
+ )
@classmethod
def recognizes(cls, file):
@@ -310,4 +312,10 @@ class DotBuildinfoFile(DebControlFile):
with open(file.path, "rb") as f:
file._deb822 = Dsc(f)
+ # Check we have a *Debian* .buildinfo file
+ if not (
+ "Format" in file._deb822 and "Checksums-Sha256" in file._deb822
+ ):
+ return False
+
return True
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2cd654b450ce82fb86f55223cc01ba1abdac58a8...931bf77bd5454949f2284bde932f9d6276a0347d
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2cd654b450ce82fb86f55223cc01ba1abdac58a8...931bf77bd5454949f2284bde932f9d6276a0347d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210507/b237693d/attachment.htm>
More information about the rb-commits
mailing list