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>2017-12-04 13:25:58 +0100
committerErich Eckner <git@eckner.net>2017-12-04 13:25:58 +0100
commit4cdeb55f66d0c3605b2b6ed16a103316cc5c414b (patch)
tree7f63cbd49ff33db4a77c81eb726104ed76e18e47
parentdc8edb511b07f4729436bb8f883d4b73845a9d43 (diff)
bin/mysql-functions: add_install_target new
-rwxr-xr-xbin/mysql-functions18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/mysql-functions b/bin/mysql-functions
index d9962a9..5148773 100755
--- a/bin/mysql-functions
+++ b/bin/mysql-functions
@@ -137,3 +137,21 @@ mysql_show_binary_package() {
'
)" --html
}
+
+# mysql_add_install_target $install_target
+
+# shellcheck disable=SC2016,2086
+mysql_add_install_target() {
+ local install_target
+ install_target=$(
+ printf "%s" "$1" | \
+ base64 -w0
+ )
+
+ ${mysql_command} "$(
+ printf 'INSERT IGNORE INTO `install_targets` (`name`)'
+ printf ' VALUES (from_base64("%s"))' \
+ "${install_target}"
+ printf '\n'
+ )"
+}