From 6a329888b446ed9173c47ada5a3e01977cf4273c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 7 Jun 2018 13:14:28 +0200 Subject: sanity checks make use of new mysql_package_name_query --- bin/sanity-check | 1 - lib/mysql-functions | 44 +++++++++----------------------------------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/bin/sanity-check b/bin/sanity-check index b2f11c2..21c891d 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -409,7 +409,6 @@ while [ $# -gt 0 ]; do done done } | \ - sed 's/\(-[0-9]\+\)\.0\(-[^- ]\+$\)/\1\2/' | \ sort -k2 | \ uniq -uf1 ) diff --git a/lib/mysql-functions b/lib/mysql-functions index 0de438f..6619968 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -673,13 +673,9 @@ mysql_sanity_check() { 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/ + sed ' + /\.pkg\.tar\.xz$/!d s|^|'"${arch}"'/'"${dir}"'/| - p ' done done | \ @@ -687,15 +683,9 @@ mysql_sanity_check() { "${temp_dir}/master-mirror-listing" { - printf 'SELECT `r_a`.`name`,`repositories`.`name`,' - printf '`binary_packages`.`%s`,' \ - 'pkgname' \ - 'epoch' \ - 'pkgver' \ - 'pkgrel' \ - 'sub_pkgrel' - printf '`architectures`.`name`' - printf ' FROM `binary_packages_in_repositories`' + printf 'SELECT CONCAT(`r_a`.`name`,"/",`repositories`.`name`,"/",' + mysql_package_name_query + printf ') FROM `binary_packages_in_repositories`' mysql_join_binary_packages_in_repositories_binary_packages mysql_join_binary_packages_architectures mysql_join_binary_packages_in_repositories_repositories @@ -721,12 +711,9 @@ mysql_sanity_check() { # 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 + sed ' + s/\.sig$// + /\.pkg\.tar\.xz$/ !d ' | \ sort | \ uniq -c | \ @@ -736,13 +723,7 @@ mysql_sanity_check() { { printf 'SELECT ' - printf '`binary_packages`.`%s`,' \ - 'pkgname' \ - 'epoch' \ - 'pkgver' \ - 'pkgrel' \ - 'sub_pkgrel' - printf '`architectures`.`name`' + mysql_package_name_query printf ' FROM `binary_packages`' mysql_join_binary_packages_architectures printf ' WHERE NOT EXISTS (' @@ -758,13 +739,6 @@ mysql_sanity_check() { printf ')' } | \ mysql_run_query | \ - sed ' - s,\t,-, - s,\t,:, - s,\t,-, - s,\t,., - s,\t,-, - ' | \ sort > \ "${temp_dir}/mysql-packages-pool" -- cgit v1.2.3-70-g09d2