summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-01 14:26:10 +0100
committerErich Eckner <git@eckner.net>2018-02-01 14:26:10 +0100
commit95c2ffe83ed58a13272df53acc5023d547be0c6d (patch)
treec30ea115d01b877a11001d7fead9039a954f4bac /bin/get-assignment
parenta03d072cc472de7d2707b97079335d17025bd475 (diff)
downloadbuilder-95c2ffe83ed58a13272df53acc5023d547be0c6d.tar.xz
bin/get-assignment: reset priority when handing out a build assignment
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 0c7915d..7e8d25f 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -69,8 +69,20 @@ hand_out_assignment() {
printf ' `upstream_repositories`.`name` = from_base64("%s")' \
"$(printf '%s' "$4" | base64 -w0)"
printf ')'
- printf ' WHERE `build_slaves`.`name`=from_base64("%s");' \
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
"$(printf '%s' "${slave}" | base64 -w0)"
+
+ printf 'UPDATE `build_assignments`'
+ printf ' JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id`'
+ printf ' JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository`=`upstream_repositories`.`id`'
+ printf ' SET `build_assignments`.`priority`=0'
+ printf ' WHERE'
+ printf ' `package_sources`.`%s` = from_base64("%s") AND' \
+ 'pkgbase' "$(printf '%s' "$1" | base64 -w0)" \
+ 'git_revision' "$(printf '%s' "$2" | base64 -w0)" \
+ 'mod_git_revision' "$(printf '%s' "$3" | base64 -w0)"
+ printf ' `upstream_repositories`.`name` = from_base64("%s");\n' \
+ "$(printf '%s' "$4" | base64 -w0)"
} | \
${mysql_command}