summaryrefslogtreecommitdiff
path: root/bin/modify-package-state
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-31 21:17:08 +0100
committerErich Eckner <git@eckner.net>2018-01-31 21:17:08 +0100
commit9baf70d2df76a5386208daecc6ce8fec11c1d560 (patch)
tree67eb0bdb6d065845da4dc543e7a6362256dc9b5e /bin/modify-package-state
parent65d82cf9a76c8442248a9eaf77a053c47c2ae415 (diff)
downloadbuilder-9baf70d2df76a5386208daecc6ce8fec11c1d560.tar.xz
bin/modify-package-state: we should modify the files, too - for now
Diffstat (limited to 'bin/modify-package-state')
-rwxr-xr-xbin/modify-package-state27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/modify-package-state b/bin/modify-package-state
index 5e4face..3ae5c58 100755
--- a/bin/modify-package-state
+++ b/bin/modify-package-state
@@ -235,6 +235,33 @@ while read -r package reason; do
grep -qxF '1'; then
printf 'UPDATE %s SET %s %s' "${combiner}" "${modifier}" "${selector}" | \
${mysql_command}
+ case "${action}" in
+ 'block')
+ printf '%s' "${reason}" > \
+ "${work_dir}/package-states/${package}.blocked"
+ ;;
+ 'unblock')
+ rm -f "${work_dir}/package-states/${package}.blocked"
+ ;;
+ 'faulty')
+ if [ -f "${work_dir}/package-states/${package}.tested" ]; then
+ mv \
+ "${work_dir}/package-states/${package}.tested" \
+ "${work_dir}/package-states/${package}.testing"
+ fi
+ ;;
+ 'tested')
+ if [ -f "${work_dir}/package-states/${package}.testing" ]; then
+ mv \
+ "${work_dir}/package-states/${package}.testing" \
+ "${work_dir}/package-states/${package}.tested"
+ fi
+ ;;
+ *)
+ >&2 printf 'Whooops, action "%s" not implemented yet.\n' "${action}"
+ exit 42
+ ;;
+ esac
fi
done \
< "${input_file}" \