summaryrefslogtreecommitdiff
path: root/bin/interpret-mail
diff options
context:
space:
mode:
Diffstat (limited to 'bin/interpret-mail')
-rwxr-xr-xbin/interpret-mail34
1 files changed, 25 insertions, 9 deletions
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