diff options
author | Erich Eckner <git@eckner.net> | 2018-06-07 13:14:28 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-07 13:14:28 +0200 |
commit | 6a329888b446ed9173c47ada5a3e01977cf4273c (patch) | |
tree | 2ab4ce6ba0f9d6b3679d3ae0fab31b14a31164d9 | |
parent | f5b3df8e4e9b04a7f06f1051fc1f90c3de443747 (diff) | |
download | builder-6a329888b446ed9173c47ada5a3e01977cf4273c.tar.xz |
sanity checks make use of new mysql_package_name_query
-rwxr-xr-x | bin/sanity-check | 1 | ||||
-rwxr-xr-x | 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" |