From 6a7946cfca0354ad33783b250ee399701cb4967d Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sat, 20 Jun 2020 10:43:29 +0200 Subject: Introduce new pkgs_print() helper function Depending on if a suffix should be included in the printout of the package set accordingly the format string for the printf invocation. The idea is depending on if only on release is supported the listing in the dsa-needed.txt should be either: -- pkg -- if only one suite is supported. In the case multiple suites are supported but the package needs an update only in one release, the listing should be -- $pkg/release -- Introduce helper function taking arguments as package, flag for suffix inclusion an to be used suffix. A later commit will use the new helper function where needed. Signed-off-by: Salvatore Bonaccorso --- bin/add-dsa-needed.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin') diff --git a/bin/add-dsa-needed.sh b/bin/add-dsa-needed.sh index e38fdd653b..1de14aec65 100755 --- a/bin/add-dsa-needed.sh +++ b/bin/add-dsa-needed.sh @@ -34,6 +34,18 @@ cleanup() { } trap cleanup EXIT +pkgs_print() { + local pkg=$1 + local include_suffix=$2 + local suffix=$3 + + if $include_suffix ; then + printf "%s/%s\n--\n" "$pkg" "$suffix" + else + printf "%s\n--\n" "$pkg" + fi +} + output=data/dsa-needed.txt case "${1:-}" in --stdout) -- cgit v1.2.3