Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/prioritize-build-list
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-01 14:51:49 +0100
committerErich Eckner <git@eckner.net>2018-02-01 14:51:49 +0100
commite46909f8589a0dadffafbe1f59997be3252afb5f (patch)
treee908a07b1dfe7f387a1b298f2e78d6ea0cb70bfd /bin/prioritize-build-list
parentabf2c85b1d4b87a04dbb8d0d707f84308838861f (diff)
bin/prioritize-build-list: only set priority of matchin packages ;-)
Diffstat (limited to 'bin/prioritize-build-list')
-rwxr-xr-xbin/prioritize-build-list15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/prioritize-build-list b/bin/prioritize-build-list
index 021e5c2..d611e79 100755
--- a/bin/prioritize-build-list
+++ b/bin/prioritize-build-list
@@ -32,13 +32,20 @@ fi
# shellcheck disable=SC2016
{
printf 'UPDATE `build_assignments`'
- printf ' JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id`'
+ printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
+ 'package_sources' 'build_assignments' 'package_source' 'package_sources' \
+ 'binary_packages' 'binary_packages' 'build_assignment' 'build_assignments' \
+ 'repositories' 'binary_packages' 'repository' 'repositories'
printf ' SET `build_assignments`.`priority`=('
- printf 'SELECT COALESCE(MAX(`others`.`priority`),0)+1'
- printf ' FROM `build_assignments` AS `others`'
+ printf 'SELECT COALESCE(MAX(`all_priorities`.`priority`),0)+1'
+ printf ' FROM ('
+ printf 'SELECT `others`.`priority`'
+ printf ' FROM `build_assignments` AS `others`'
+ printf ') AS `all_priorities`'
printf ')'
- printf ' WHERE `package_sources`.`pkgbase` REGEXP from_base64("%s");\n' \
+ printf ' WHERE `package_sources`.`pkgbase` REGEXP from_base64("%s")' \
"$(printf '%s' "$1" | base64 -w0)"
+ printf ' AND `repositories`.`name`="build-list";\n'
} | \
${mysql_command}