index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-03-23 20:18:01 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2018-03-23 20:18:01 +0100 |
commit | c30de005f885202f24929bd4e3d3f5c885efbc0a (patch) | |
tree | 44b512356b80d3adad6521ad74f38ff9271f6c0d /bin/interpret-mail | |
parent | ff768f012bfef1bf264d06214aead70a58c0ff90 (diff) | |
parent | 497779257683e1c4ee2f2bf4c25687b34323c6be (diff) |
-rwxr-xr-x | bin/interpret-mail | 34 |
diff --git a/bin/interpret-mail b/bin/interpret-mail index d16c07f..83c8999 100755 --- a/bin/interpret-mail +++ b/bin/interpret-mail @@ -5,6 +5,8 @@ # TODO: enable email interface to delete packages +# TODO: read information from database (?) + if [ $# -ne 0 ]; then >&2 echo '' >&2 echo 'usage: interpret-mail' @@ -21,15 +23,18 @@ if [ $# -ne 0 ]; then >&2 echo ' - "block: <state-file> <reason>":' >&2 echo ' Block the given packge for the given reason.' >&2 echo '' + >&2 echo ' - "copy-to-build-support: <pkgname>":' + >&2 echo ' Copy the given binary package into [build-support].' + >&2 echo '' + >&2 echo ' - "schedule: <pkgbase>":' + >&2 echo ' Put the given package on the build list (again).' + >&2 echo '' >&2 echo ' - "stabilize: <package-file>":' >&2 echo ' Mark the given package as tested.' >&2 echo '' >&2 echo ' - "unblock: <state-file>":' >&2 echo ' Unblock the given packge.' >&2 echo '' - >&2 echo ' - "schedule: <pkgname>":' - >&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 '' @@ -156,14 +161,14 @@ sed -n ' /\n$/!ba s/\n$// p -' "${tmp_dir}/plain-content" | +' "${tmp_dir}/plain-content" | \ sed ' :start_loop $!{ N bstart_loop } - s/=\s*\n//g + s/[=\]\s*\n//g s/:\s*\n/: /g s/\n\(\S\+[^: ]\(\s\|\n\|$\)\)/ \1/g ' > \ @@ -185,7 +190,7 @@ sed -n "$( )" "${tmp_dir}/raw-content" if [ -s "${tmp_dir}/block" ]; then - if run_and_log_on_error "${base_dir}/bin/modify-package-state" --block "${tmp_dir}/block"; then + if run_and_log_on_error "${base_dir}/bin/modify-package-state" --wait --block "${tmp_dir}/block"; then log 'Successfully blocked %s packages.\n' "$(wc -l < "${tmp_dir}/block")" else log 'There was an error while blocking the packages - ignoring this message.\n' @@ -196,7 +201,7 @@ if [ -s "${tmp_dir}/stabilize" ]; then sed -i ' /\.pkg\.tar\.xz$/!s/$/.pkg.tar.xz/ ' "${tmp_dir}/stabilize" - if run_and_log_on_error "${base_dir}/bin/modify-package-state" --tested "${tmp_dir}/stabilize"; then + if run_and_log_on_error "${base_dir}/bin/modify-package-state" --wait --tested "${tmp_dir}/stabilize"; then log 'Successfully marked %s packages as tested.\n' "$(wc -l < "${tmp_dir}/stabilize")" else log 'There was an error while marking the packages as tested - ignoring this message.\n' @@ -204,7 +209,7 @@ if [ -s "${tmp_dir}/stabilize" ]; then fi if [ -s "${tmp_dir}/unblock" ]; then - if run_and_log_on_error "${base_dir}/bin/modify-package-state" --unblock "${tmp_dir}/unblock"; then + if run_and_log_on_error "${base_dir}/bin/modify-package-state" --wait --unblock "${tmp_dir}/unblock"; then log 'Successfully unblocked %s packages.\n' "$(wc -l < "${tmp_dir}/unblock")" else log 'There was an error while unblocking the packages - ignoring this message.\n' @@ -213,7 +218,7 @@ fi if [ -s "${tmp_dir}/schedule" ]; then # shellcheck disable=SC2046 - "${base_dir}/bin/seed-build-list" $( + "${base_dir}/bin/seed-build-list" --wait $( tr '[:space:]' '\n' < \ "${tmp_dir}/schedule" | \ grep -vxF '' | \ @@ -224,3 +229,14 @@ if [ -s "${tmp_dir}/schedule" ]; then sponge "${tmp_dir}/schedule" log 'Successfully (re)scheduled %s packages.\n' "$(wc -l < "${tmp_dir}/schedule")" fi + +if [ -s "${tmp_dir}/copy-to-build-support" ]; then + sed -i ' + /\.pkg\.tar\.xz$/!s/$/.pkg.tar.xz/ + ' "${tmp_dir}/copy-to-build-support" + if run_and_log_on_error "${base_dir}/bin/copy-to-build-support" --wait "${tmp_dir}/copy-to-build-support"; then + log 'Successfully copied %s packages to [build-support].\n' "$(wc -l < "${tmp_dir}/copy-to-build-support")" + else + log 'There was an error while copying the packages to [build-support] - ignoring this message.\n' + fi +fi |