Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-31 10:18:06 +0200
committerErich Eckner <git@eckner.net>2018-05-31 10:18:06 +0200
commita7a1b30eb62c82b95e5cacf938aedc091bd4c1c3 (patch)
tree8172dbb9f5361740a71cd377d489aa5e63d1a21b /lib
parente10413d782fc778f4257675431583310ce1b6df1 (diff)
lib/mysql-functions: new check (not yet activated) in mysql_sanity_check()
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index de3e46e..b637afc 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -708,6 +708,50 @@ mysql_sanity_check() {
diff -u \
"${temp_dir}/master-mirror-listing" \
"${temp_dir}/mysql-packages"
+
+ # shellcheck disable=SC2041
+ ls_master_mirror 'pool' | \
+ sed -n '
+ s/\.pkg\.tar\.xz\(\.sig\)\?$//
+ T
+ s/-\([0-9]\+\)-\([^-]\+\)$/-\1.0-\2/
+ s/-\([^-:]\+-[^-]\+-[^-]\+\)$/-0:\1/
+ p
+ ' | \
+ sort | \
+ uniq -c | \
+ grep '^\s*2\s' | \
+ awk '{print $2}' > \
+ "${temp_dir}/master-mirror-pool"
+
+ {
+ printf 'SELECT '
+ printf '`binary_packages`.`%s`,' \
+ 'pkgname' \
+ 'epoch' \
+ 'pkgver' \
+ 'pkgrel' \
+ 'sub_pkgrel'
+ printf '`architectures`.`name`'
+ printf ' FROM `binary_packages`'
+ mysql_join_binary_packages_architectures
+ printf ' WHERE `binary_packages`.`sha512sum` IS NOT NULL'
+ } | \
+ mysql_run_query | \
+ sed '
+ s,\t,-,
+ s,\t,:,
+ s,\t,-,
+ s,\t,.,
+ s,\t,-,
+ ' | \
+ sort > \
+ "${temp_dir}/mysql-packages-pool"
+
+# TODO: activate that check
+ diff -u \
+ "${temp_dir}/master-mirror-pool" \
+ "${temp_dir}/mysql-packages-pool" >&2
)
}