diff options
author | Erich Eckner <git@eckner.net> | 2020-02-04 22:22:59 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-02-04 22:22:59 +0100 |
commit | 3771352050c5cf1a103af8faf0711164d724083b (patch) | |
tree | 73195584e89b00c588410e86262d03d106532f15 /lib | |
parent | 43b983ff97df9216c966023c50ceac9f4a4c36e4 (diff) | |
download | builder-3771352050c5cf1a103af8faf0711164d724083b.tar.xz |
lib/mysql-functions: save input files of successful queries, too
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/mysql-functions | 8 |
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}" |