summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-03 14:34:19 +0200
committerErich Eckner <git@eckner.net>2018-05-03 14:34:19 +0200
commit05f9e7441da092c9353c8bd4a050aab9868b2e22 (patch)
tree5ab65ca252401fb7844ad26bebb0206bc5fede48 /lib
parente7165b896d38518068b91d7aaac52cb16bbbe59c (diff)
downloadbuilder-05f9e7441da092c9353c8bd4a050aab9868b2e22.tar.xz
lib/mysql-functions: check more architectures in mysql_sanity_check()
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index df9cf77..b925b2e 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -746,30 +746,35 @@ mysql_sanity_check() {
temp_dir=$(mktemp -d 'tmp.mysql-functions.mysql_sanity_check.XXXXXXXXXX' --tmpdir)
trap 'rm -rf --one-file-system "${temp_dir}"' EXIT
- for dir in $(ls_master_mirror 'i686'); do
- ls_master_mirror "i686/${dir}" | \
- sed -n '
- s/\.pkg\.tar\.xz$//
- T
- s/-\([0-9]\+\)-\([^-]\+\)$/-\1.0-\2/
- s/-\([^-:]\+-[^-]\+-[^-]\+\)$/-0:\1/
- s|^|'"${dir}"'/|
- p
- '
+ # shellcheck disable=SC2041
+ for arch in 'i686'; do
+ for dir in $(ls_master_mirror "${arch}"); do
+ ls_master_mirror "${arch}/${dir}" | \
+ sed -n '
+ s/\.pkg\.tar\.xz$//
+ T
+ s/-\([0-9]\+\)-\([^-]\+\)$/-\1.0-\2/
+ s/-\([^-:]\+-[^-]\+-[^-]\+\)$/-0:\1/
+ s|^|'"${arch}"'/'"${dir}"'/|
+ p
+ '
+ done
done | \
sort > \
"${temp_dir}/master-mirror-listing"
{
- printf 'SELECT `repositories`.`name`,`pkgname`,`epoch`,`pkgver`,`pkgrel`,`sub_pkgrel`,`architectures`.`name`'
+ printf 'SELECT `r_a`.`name`,`repositories`.`name`,`pkgname`,`epoch`,`pkgver`,`pkgrel`,`sub_pkgrel`,`architectures`.`name`'
printf ' FROM `binary_packages`'
mysql_join_binary_packages_architectures
mysql_join_binary_packages_repositories
+ mysql_join_repositories_architectures '' 'r_a'
printf ' WHERE `repositories`.`is_on_master_mirror`'
} | \
mysql_run_query | \
sed '
s,\t,/,
+ s,\t,/,
s,\t,-,
s,\t,:,
s,\t,-,