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>2018-03-29 16:09:53 +0200
committerErich Eckner <git@eckner.net>2018-03-29 16:09:53 +0200
commit2e95564029e21323a58f80589aebd7c16448c507 (patch)
treeaeaca35a8369910f3f5ad7d59cdc9a3337de59b6
parent790ca15472478f9c714e11067fcc956fbe0fb572 (diff)
make mysql_files_table_partitions dynamically determined in lib/mysql-functions instead of statically configured in conf/default.conf
-rwxr-xr-xconf/default.conf2
-rwxr-xr-xlib/mysql-functions10
2 files changed, 10 insertions, 2 deletions
diff --git a/conf/default.conf b/conf/default.conf
index ec57a7c..efbb5b4 100755
--- a/conf/default.conf
+++ b/conf/default.conf
@@ -34,8 +34,6 @@ master_build_server_identity="${work_dir}/.ssh/id_rsa"
repo_key='0xdeadbeef'
package_key='0x15eebadc0de'
-mysql_files_table_partitions=16
-
# what can be done via the email interface
possible_email_actions='stabilize block unblock schedule copy-to-build-support'
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 0625616..7619c10 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -1232,3 +1232,13 @@ mysql_insert_package_files_query() {
done
}
+
+mysql_files_table_partitions=$(
+ printf 'SHOW CREATE TABLE `files`;\n' | \
+ mysql_run_query | \
+ sed -n '
+ s/^.*PARTITIONS \([0-9]\+\) .*$/\1/
+ T
+ p
+ '
+)