checksums: add SHA-512 and a Checksums-* field parser

The checksum model only carried md5/sha1/sha256 while deb-buildinfo(5)
defines Checksums-Sha512, and there was no way to parse a Checksums-*
field body back into entries. Add ChecksumKind::Sha512 (computed
alongside the others), a field parser validating the
'<hex> <size> <name>' grammar, and an only-if-populated
Checksums-Sha512 emission in .buildinfo — deliberately dormant in the
dpkg-parity flows, which never emit it, and .dsc/.changes untouched.
This commit is contained in:
2026-09-17 19:44:54 +02:00
parent d6bad9fbbe
commit 93296c26c1
5 changed files with 364 additions and 4 deletions
+4
View File
@@ -544,6 +544,10 @@ pub fn run_source_build(
md5: partial.md5.clone().unwrap_or_default(),
sha1: partial.sha1.clone().unwrap_or_default(),
sha256: partial.sha256.clone().unwrap_or_default(),
// The .dsc records no SHA-512 (dpkg only writes sha1/sha256
// there); the empty digest keeps the .buildinfo's
// `Checksums-Sha512` field omitted.
sha512: String::new(),
},
);
tarball_paths.push(path);