summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-07 13:14:28 +0200
committerErich Eckner <git@eckner.net>2018-06-07 13:14:28 +0200
commit6a329888b446ed9173c47ada5a3e01977cf4273c (patch)
tree2ab4ce6ba0f9d6b3679d3ae0fab31b14a31164d9 /lib
parentf5b3df8e4e9b04a7f06f1051fc1f90c3de443747 (diff)
downloadbuilder-6a329888b446ed9173c47ada5a3e01977cf4273c.tar.xz
sanity checks make use of new mysql_package_name_query
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions44
1 files changed, 9 insertions, 35 deletions
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"