From d2e0ef2a558e27e07150f239d91e4c29ce822426 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 16 Feb 2018 11:14:03 +0100 Subject: bin/mysql-functions: mysql_join_*_* new --- bin/modify-package-state | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'bin/modify-package-state') diff --git a/bin/modify-package-state b/bin/modify-package-state index b2d3133..b0ba53e 100755 --- a/bin/modify-package-state +++ b/bin/modify-package-state @@ -136,10 +136,9 @@ while read -r package reason; do # shellcheck disable=SC2016 combiner=$( printf '`binary_packages`' - printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ - 'repositories' 'repositories' 'binary_packages' 'repository' \ - 'repository_stabilities' 'repository_stabilities' 'repositories' 'stability' \ - 'architectures' 'architectures' 'binary_packages' 'architecture' + mysql_join_binary_packages_repositories + mysql_join_repositories_repository_stabilities + mysql_join_binary_packages_architectures ) # shellcheck disable=SC2016,SC2031 selector=$( @@ -161,12 +160,11 @@ while read -r package reason; do # shellcheck disable=SC2016 combiner=$( printf '`build_assignments`' - printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ - 'package_sources' 'package_sources' 'build_assignments' 'package_source' \ - 'upstream_repositories' 'upstream_repositories' 'package_sources' 'upstream_package_repository' \ - 'binary_packages' 'build_assignments' 'binary_packages' 'build_assignment' \ - 'repositories' 'repositories' 'binary_packages' 'repository' \ - 'repository_stabilities' 'repository_stabilities' 'repositories' 'stability' + mysql_join_build_assignments_package_sources + mysql_join_package_sources_upstream_repositories + mysql_join_build_assignments_binary_packages + mysql_join_binary_packages_repositories + mysql_join_repositories_repository_stabilities ) # shellcheck disable=SC2016 selector=$( @@ -238,8 +236,7 @@ while read -r package reason; do printf 'UPDATE `binary_packages` AS `a`' printf ' JOIN `binary_packages` AS `b`' printf ' ON `a`.`build_assignment`=`b`.`build_assignment`' - printf ' JOIN `repositories`' - printf ' ON `b`.`repository`=`repositories`.`id`' + mysql_join_binary_packages_repositories 'b' printf ' SET `b`.`is_tested`=1' printf ' WHERE `a`.`is_tested`' printf ' AND NOT `b`.`is_tested`' -- cgit v1.2.3-70-g09d2