From 52b93f6ad26f6b5a83c5e09b36e1b18b96ea9857 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 23 Nov 2017 08:50:44 +0100 Subject: bin/interpret-mail: action "schedule" new; bin/seed-build-list: bail out early if no arguments, print scheduled packages (even if -n not given) --- bin/interpret-mail | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bin/interpret-mail') diff --git a/bin/interpret-mail b/bin/interpret-mail index f2b7d26..0401498 100755 --- a/bin/interpret-mail +++ b/bin/interpret-mail @@ -29,6 +29,9 @@ if [ $# -ne 0 ]; then >&2 echo ' - "unblock: ":' >&2 echo ' Unblock the given packge.' >&2 echo '' + >&2 echo ' - "schedule: ":' + >&2 echo ' Put the given package on the build list (again).' + >&2 echo '' >&2 echo ' - ALL: all of the above (only valid in' >&2 echo ' "conf/admin-gpg-keys")' >&2 echo '' @@ -215,3 +218,19 @@ if [ -s "${tmp_dir}/unblock" ]; then log 'There was an error while unblocking the packages - ignoring this message.\n' fi fi + +if [ -s "${tmp_dir}/schedule" ]; then + # shellcheck disable=SC2046 + "${base_dir}/bin/seed-build-list" $( + tr '[:space:]' '\n' < \ + "${tmp_dir}/schedule" | \ + grep -vxF '' | \ + while read -r package; do + printf -- '-p ^%s$\n' "$(str_to_regex "${package}")" + done + ) | \ + sponge "${tmp_dir}/schedule" + if [ -s "${tmp_dir}/schedule" ]; then + log 'Successfully (re)scheduled %s packages.\n' "$(wc -l < "${tmp_dir}/schedule")" + fi +fi -- cgit v1.2.3-70-g09d2