STRING_AGG(
CASE
WHEN key = 'Source' THEN E'Package\: '
- WHEN key = 'Files' THEN E'Files\:\n ' || f.md5sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
- WHEN key = 'Checksums-Sha1' THEN E'Checksums-Sha1\:\n ' || f.sha1sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
- WHEN key = 'Checksums-Sha256' THEN E'Checksums-Sha256\:\n ' || f.sha256sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
+ WHEN key = 'Files' AND sui.checksums && array['md5sum'] THEN E'Files\:\n ' || f.md5sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
+ WHEN key = 'Files' THEN NULL
+ WHEN key = 'Checksums-Sha1' AND sui.checksums && array['sha1'] THEN E'Checksums-Sha1\:\n ' || f.sha1sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
+ WHEN key = 'Checksums-Sha1' THEN NULL
+ WHEN key = 'Checksums-Sha256' AND sui.checksums && array['sha256'] THEN E'Checksums-Sha256\:\n ' || f.sha256sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
+ WHEN key = 'Checksums-Sha256' THEN NULL
ELSE key || E'\: '
END || value, E'\n' ORDER BY mk.ordering, mk.key)
FROM
AND o.type = :dsc_type
LEFT JOIN section sec ON o.section = sec.id
LEFT JOIN priority pri ON o.priority = pri.id
+LEFT JOIN suite sui on sui.id = :suite
ORDER BY
s.source, s.version