Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/sanity-check
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-07-17 20:58:14 +0200
committerErich Eckner <git@eckner.net>2023-07-17 20:58:14 +0200
commitcc4f6dcf65e004fa5c69082953fe29db0d2e158e (patch)
tree0e69cbd13fc835d525557a229476f85cef340099 /bin/sanity-check
parent5b1d7ff5b9c42bed0bcdfcb42ff2f5bb799562fc (diff)
bin/sanity-check: do all db operations after getting the lock
* no need to trouble the db, if we don't run, because we got no lock
Diffstat (limited to 'bin/sanity-check')
-rwxr-xr-xbin/sanity-check47
1 files changed, 24 insertions, 23 deletions
diff --git a/bin/sanity-check b/bin/sanity-check
index 36d4db0..4ab0c9e 100755
--- a/bin/sanity-check
+++ b/bin/sanity-check
@@ -46,29 +46,6 @@ eval set -- "$(
block_flag='-n'
silence=0
-# shellcheck disable=SC2016
-repos=$(
- {
- printf 'SELECT DISTINCT `repositories`.`name`'
- printf ' FROM `repositories`'
- printf ' WHERE `repositories`.`is_on_master_mirror`;\n'
- } | \
- mysql_run_query
-)
-# shellcheck disable=SC2016
-archs=$(
- {
- printf 'SELECT DISTINCT `architectures`.`name`'
- printf ' FROM `architectures`'
- printf ' WHERE EXISTS ('
- printf 'SELECT 1'
- printf ' FROM `repositories`'
- printf ' WHERE `repositories`.`architecture`=`architectures`.`id`'
- printf ' AND `repositories`.`is_on_master_mirror`'
- printf ');\n'
- } | \
- mysql_run_query
-)
while true
do
@@ -104,6 +81,30 @@ if ! verbose_flock ${block_flag} 9; then
exit
fi
+# shellcheck disable=SC2016
+repos=$(
+ {
+ printf 'SELECT DISTINCT `repositories`.`name`'
+ printf ' FROM `repositories`'
+ printf ' WHERE `repositories`.`is_on_master_mirror`;\n'
+ } | \
+ mysql_run_query
+)
+# shellcheck disable=SC2016
+archs=$(
+ {
+ printf 'SELECT DISTINCT `architectures`.`name`'
+ printf ' FROM `architectures`'
+ printf ' WHERE EXISTS ('
+ printf 'SELECT 1'
+ printf ' FROM `repositories`'
+ printf ' WHERE `repositories`.`architecture`=`architectures`.`id`'
+ printf ' AND `repositories`.`is_on_master_mirror`'
+ printf ');\n'
+ } | \
+ mysql_run_query
+)
+
mysql_cleanup
finish() {