summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-31 11:58:56 +0100
committerErich Eckner <git@eckner.net>2018-01-31 11:58:56 +0100
commit90a901dd785c216c4000b23352f2b0bf278ae231 (patch)
tree90ec349017eff194cdd04d7ad91e3d99300da160 /bin/get-assignment
parent3c733778909fd15af6308fda7f82fa995c6660b4 (diff)
downloadbuilder-90a901dd785c216c4000b23352f2b0bf278ae231.tar.xz
bin/get-assignment: hand out all-dep-met packages first and loops later
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index ec8dad2..27b622b 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -149,6 +149,8 @@ next_building=$(
printf ' FROM `failed_builds`'
printf ' WHERE `failed_builds`.`build_assignment`=`build_assignments`.`id`'
printf ') AS `trials`,'
+ mysql_query_is_part_of_loop '`build_assignments`.`id`'
+ printf ' AS `part_of_loop`,'
mysql_query_select_pkgbase_and_revision
printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \
'binary_packages' 'build_assignments' 'binary_packages' 'build_assignment' \
@@ -171,14 +173,14 @@ next_building=$(
printf ' OR NOT '
mysql_query_has_pending_dependencies '`build_assignments`.`id`'
printf ')'
- printf ' ORDER BY `requested` DESC, `trials`, `build_assignments`.`id`'
+ printf ' ORDER BY `requested` DESC, `trials`, `part_of_loop`, `build_assignments`.`id`'
printf ' LIMIT 1;\n'
} | \
${mysql_command} --batch --raw | \
sed '
1d
y/\t/ /
- s/^\S\+ \S\+ //
+ s/^\(\S\+ \)\{3\}//
'
)
if [ -n "${next_building}" ]; then