diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2020-06-20 10:43:29 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2020-06-22 10:36:49 +0200 |
commit | cbe490ff5d82e8e7aace9a51baa90107ef0f1d67 (patch) | |
tree | cb3146f763fc739b0ef069b83b9c4dc8712cb7cc /bin/add-dsa-needed.sh | |
parent | 6ab72d1d7f4d5ab7e76c0b5ee505f84429d38748 (diff) |
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 <carnil@debian.org>
Diffstat (limited to 'bin/add-dsa-needed.sh')
-rwxr-xr-x | bin/add-dsa-needed.sh | 12 |
1 files changed, 12 insertions, 0 deletions
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) |