Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-06-28 15:17:09 +0200
committerErich Eckner <git@eckner.net>2019-06-28 15:17:09 +0200
commitc0551a94fd73e5184e673404e01d255be21cf2f0 (patch)
treefba1ed87b557f153654439fac4703fd67d076628 /bin/return-assignment
parentbab02966e03876106d6ca38e5fc8029a81bfb904 (diff)
bin/return-assignment: prioritize failed build_assignments iff a broken dependency was rescheduled
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 7b8507e..017b9e9 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -321,6 +321,24 @@ if [ "$6" = 'ERROR' ]; then
fi
)
+ # prioritize _this_ build assignment iff we rescheduled any broken dependencies
+ if [ -n "${rescheduled_packages}" ]; then
+ # shellcheck disable=SC2016
+ {
+ printf 'UPDATE `build_assignments`'
+ printf ' SET `build_assignments`.`priority`=('
+ printf 'SELECT MAX(`build_assignments`.`priority`)'
+ printf ' FROM `build_assignments`'
+ printf ')+1'
+ printf ' WHERE `build_assignments`.`id`=from_base64("%s");\n' \
+ "$(
+ printf '%s' "${build_assignment_id}" | \
+ base64 -w0
+ )"
+ } | \
+ mysql_run_query
+ fi
+
# shellcheck disable=SC2119
{
printf '%s/%s ' \