From c3e4c542a81586cf7dc731a679d6caf904830278 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 24 Sep 2018 09:29:20 +0200 Subject: bin/return-assignment: check that the packager is set --- bin/return-assignment | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/return-assignment b/bin/return-assignment index 45ff3d3..2fd533e 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -19,8 +19,6 @@ # TODO: sign database -# TODO: check packager - # shellcheck disable=SC2119,SC2120 # shellcheck source=../lib/load-configuration @@ -448,6 +446,23 @@ if [ -z "$( exit 3 fi +# check if the package maintainer is set +errors=$( + find . -maxdepth 1 -name '*.pkg.tar.xz' | \ + while read -r pkg; do + tar -OxJf "${pkg}" '.BUILDINFO' 2>/dev/null | \ + grep -vxF 'packager = Unknown Packager' | \ + grep -q '^packager = ' || \ + printf '%s misses a valid packager.\n' \ + "${pkg##*/}" + done +) +if [ -n "${errors}" ]; then + >&2 echo 'Packager error(s):' + >&2 printf '%s' "${errors}" + exit 3 +fi + # check if the sent packages are the expected ones find . -maxdepth 1 -name '*.pkg.tar.xz' -printf '%f\n' > \ "${tmp_dir}/packages" -- cgit v1.2.3-54-g00ecf