Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-06-16 09:06:27 +0200
committerErich Eckner <git@eckner.net>2020-06-16 09:09:57 +0200
commit2d03edaec413d253485c95e99322c48444bd18c2 (patch)
tree2c69b918a2a8b3933cbde28b6f9319aee1691c81 /bin
parenta189bd13196cc7177fc27045e691064b070efa52 (diff)
bin/return-assignment: prioritize those broken haskell-packages which will not get scheduled, because they are already on the build-list
Diffstat (limited to 'bin')
-rwxr-xr-xbin/return-assignment17
1 files changed, 14 insertions, 3 deletions
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 ('