From 9baf70d2df76a5386208daecc6ce8fec11c1d560 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 31 Jan 2018 21:17:08 +0100 Subject: bin/modify-package-state: we should modify the files, too - for now --- bin/modify-package-state | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'bin') 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}" \ -- cgit v1.2.3-70-g09d2