diff options
author | Erich Eckner <git@eckner.net> | 2018-01-31 21:17:08 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-01-31 21:17:08 +0100 |
commit | 9baf70d2df76a5386208daecc6ce8fec11c1d560 (patch) | |
tree | 67eb0bdb6d065845da4dc543e7a6362256dc9b5e | |
parent | 65d82cf9a76c8442248a9eaf77a053c47c2ae415 (diff) | |
download | builder-9baf70d2df76a5386208daecc6ce8fec11c1d560.tar.xz |
bin/modify-package-state: we should modify the files, too - for now
-rwxr-xr-x | bin/modify-package-state | 27 |
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}" \ |