Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-07-14 22:30:39 +0200
committerErich Eckner <git@eckner.net>2023-07-14 22:30:39 +0200
commitddf0be8a7d00ad20f9dd73e244cf50c6baf779f2 (patch)
tree2b884f1d3e6fbec7f5b908a18d51844ba3df4ead
parent70a9d1c9ad752e4bb32db0722d687dac136b3bc2 (diff)
mysql_run_query(): if it is called by an intention, log the whole intention
-rwxr-xr-xlib/mysql-functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 5695b97..efa7c54 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -48,6 +48,12 @@ mysql_run_query() {
query_stderr="${query_stdin%.stdin}.stderr"
{
printf -- '-- called by %s\n' "$0"
+ if printf '%s\n' "$0" \
+ | grep -qF intention; then
+ sed '
+ s@^@-- : @
+ ' "$0"
+ fi
cat
} > "${query_stdin}"
for _ in $(seq 10); do