From e46909f8589a0dadffafbe1f59997be3252afb5f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 1 Feb 2018 14:51:49 +0100 Subject: bin/prioritize-build-list: only set priority of matchin packages ;-) --- bin/prioritize-build-list | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/prioritize-build-list b/bin/prioritize-build-list index 021e5c2..d611e79 100755 --- a/bin/prioritize-build-list +++ b/bin/prioritize-build-list @@ -32,13 +32,20 @@ fi # shellcheck disable=SC2016 { printf 'UPDATE `build_assignments`' - printf ' JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id`' + printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \ + 'package_sources' 'build_assignments' 'package_source' 'package_sources' \ + 'binary_packages' 'binary_packages' 'build_assignment' 'build_assignments' \ + 'repositories' 'binary_packages' 'repository' 'repositories' printf ' SET `build_assignments`.`priority`=(' - printf 'SELECT COALESCE(MAX(`others`.`priority`),0)+1' - printf ' FROM `build_assignments` AS `others`' + printf 'SELECT COALESCE(MAX(`all_priorities`.`priority`),0)+1' + printf ' FROM (' + printf 'SELECT `others`.`priority`' + printf ' FROM `build_assignments` AS `others`' + printf ') AS `all_priorities`' printf ')' - printf ' WHERE `package_sources`.`pkgbase` REGEXP from_base64("%s");\n' \ + printf ' WHERE `package_sources`.`pkgbase` REGEXP from_base64("%s")' \ "$(printf '%s' "$1" | base64 -w0)" + printf ' AND `repositories`.`name`="build-list";\n' } | \ ${mysql_command} -- cgit v1.2.3-70-g09d2