From 2d03edaec413d253485c95e99322c48444bd18c2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 16 Jun 2020 09:06:27 +0200 Subject: bin/return-assignment: prioritize those broken haskell-packages which will not get scheduled, because they are already on the build-list --- bin/return-assignment | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index 3178d09..d040b22 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -370,9 +370,6 @@ if [ "$6" = 'ERROR' ]; then tr ' ' '\t' > \ "${tmp_dir}/broken-packages-with-version" -# TODO: prioritize those packages which will not get scheduled, because -# they are already on the build-list - # now we look if the broken packages have been rebuilt in the meantime haskell_rebuild_packages=$( # shellcheck disable=SC2016 @@ -404,6 +401,20 @@ if [ "$6" = 'ERROR' ]; then sed 's/,$//' printf ');\n' + printf 'SET @`max_priority` = (' + printf 'SELECT MAX(`build_assignments`.`priority`)' + printf ' FROM `build_assignments`' + printf ');\n' + + printf 'UPDATE `broken`' + printf ' JOIN `binary_packages`' + printf ' ON `binary_packages`.`pkgname`=`broken`.`pkgname`' + mysql_join_binary_packages_build_assignments + mysql_join_binary_packages_binary_packages_in_repositories + printf ' AND `binary_packages_in_repositories`.`repository`=%s' \ + "${repository_ids__any_build_list}" + printf ' SET `build_assignments`.`priority`=@`max_priority`+1;\n' + printf 'SELECT DISTINCT `broken`.`pkgname`' printf ' FROM `broken`' printf ' WHERE NOT EXISTS (' -- cgit v1.2.3-70-g09d2