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 22:22:59 +0100
committerErich Eckner <git@eckner.net>2020-02-04 22:22:59 +0100
commit3771352050c5cf1a103af8faf0711164d724083b (patch)
tree73195584e89b00c588410e86262d03d106532f15 /lib
parent43b983ff97df9216c966023c50ceac9f4a4c36e4 (diff)
lib/mysql-functions: save input files of successful queries, too
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 5173bfb..daef65b 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -58,6 +58,14 @@ mysql_run_query() {
> "${query_stdout}" \
2>> "${query_stderr}"; then
if grep -qF 'DELETE `binary_packages' "${query_stdin}"; then
+ sed -n '
+ s/^.*INFILE "\(\S\+\)".*$/\1/
+ T
+ p
+ ' "${query_stdin}" | \
+ while read -r file; do
+ cp "${file}" "${work_dir}/successful.${query_stdin##*/}.infile.${file##*/}"
+ done
mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}"
else
rm "${query_stdin}"