Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-04 14:50:24 +0100
committerErich Eckner <git@eckner.net>2020-02-04 14:50:24 +0100
commit43b983ff97df9216c966023c50ceac9f4a4c36e4 (patch)
treeabcd0be4fa8205d05109b3b1a192d6787478a862 /lib
parent6df5b189676fd9877ff2168e03779a667d59259c (diff)
lib/mysql-functions: only save queries which (potentially) delete binary_packages or binary_packages_in_repositories
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 4bd1164..5173bfb 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -57,7 +57,11 @@ mysql_run_query() {
< "${query_stdin}" \
> "${query_stdout}" \
2>> "${query_stderr}"; then
- mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}"
+ if grep -qF 'DELETE `binary_packages' "${query_stdin}"; then
+ mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}"
+ else
+ rm "${query_stdin}"
+ fi
rm "${query_stderr}"
fi
if ! [ -f "${query_stdin}" ]; then