From 2961c54465fca8fb45790906cb9f715cc36e204e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 13 Mar 2016 15:01:46 +0100 Subject: [PATCH] Only generate binary checksum fields for the requested ones This is the second step. As we are simply concatenating things, we can just concatenate an empty string if we do not want a checksum. --- dak/generate_packages_sources2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dak/generate_packages_sources2.py b/dak/generate_packages_sources2.py index e44d9cee..84983e16 100755 --- a/dak/generate_packages_sources2.py +++ b/dak/generate_packages_sources2.py @@ -205,9 +205,9 @@ SELECT || E'\nPriority\: ' || COALESCE(pri.priority, tmp.fallback_priority) || E'\nFilename\: pool/' || :component_name || '/' || tmp.filename || E'\nSize\: ' || tmp.size - || E'\nMD5sum\: ' || tmp.md5sum - || E'\nSHA1\: ' || tmp.sha1sum - || E'\nSHA256\: ' || tmp.sha256sum + || CASE WHEN sui.checksums && array['md5sum'] THEN E'\nMD5sum\: ' || tmp.md5sum ELSE '' END + || CASE WHEN sui.checksums && array['sha1'] THEN E'\nSHA1\: ' || tmp.sha1sum ELSE '' END + || CASE WHEN sui.checksums && array['sha256'] THEN E'\nSHA256\: ' || tmp.sha256sum ELSE '' END FROM tmp @@ -217,6 +217,7 @@ FROM AND o.component = :component LEFT JOIN section sec ON sec.id = o.section LEFT JOIN priority pri ON pri.id = o.priority + LEFT JOIN suite sui ON suite.id = :suite WHERE ( -- 2.39.5