summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-01 09:30:27 +0100
committerErich Eckner <git@eckner.net>2018-03-01 09:30:27 +0100
commit7726164a7bc661bb4c0e5bfa6b81788b375a973b (patch)
treeba6058858cfa0c9b36296d0dde778bf10b9be73a /lib
parent496c571cd233a8646351ba241c3119ceaf2b8063 (diff)
downloadbuilder-7726164a7bc661bb4c0e5bfa6b81788b375a973b.tar.xz
lib/mysql-functions: mysql_run_query logs everything, now
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 3e7e19f..d8ffeb5 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -25,7 +25,28 @@ base64_encode_each() {
# mysql_run_query
# wrapper function to query mysql
mysql_run_query() {
- ${mysql_command} "$@"
+ {
+ printf '%s %s: ' "$0" "${mysql_command} $*"
+ date
+ } \
+ | tee -a "${work_dir}/mysql.stdin" \
+ | tee -a "${work_dir}/mysql.stdout" \
+ >> "${work_dir}/mysql.stderr"
+ tee -a "${work_dir}/mysql.stdin" \
+ | ${mysql_command} "$@" \
+ 2>> "${work_dir}/mysql.stderr" \
+ | tee -a "${work_dir}/mysql.stdout"
+ for s in \
+ "${work_dir}/mysql.stdin" \
+ "${work_dir}/mysql.stdout" \
+ "${work_dir}/mysql.stderr"; do
+ {
+ tail -n 10000 "$s"
+ printf '%s %s done: ' "$0" "${mysql_command} $*"
+ date
+ } \
+ | sponge "$s"
+ done
}
# mysql_add_package_source $pkgbase $git_revision $mod_git_revision $upstream_package_repository