index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-03-23 20:18:01 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2018-03-23 20:18:01 +0100 |
commit | c30de005f885202f24929bd4e3d3f5c885efbc0a (patch) | |
tree | 44b512356b80d3adad6521ad74f38ff9271f6c0d /bin/prioritize-build-list | |
parent | ff768f012bfef1bf264d06214aead70a58c0ff90 (diff) | |
parent | 497779257683e1c4ee2f2bf4c25687b34323c6be (diff) |
-rwxr-xr-x | bin/prioritize-build-list | 19 |
diff --git a/bin/prioritize-build-list b/bin/prioritize-build-list index 06d4c06..db828ae 100755 --- a/bin/prioritize-build-list +++ b/bin/prioritize-build-list @@ -23,11 +23,24 @@ if ! flock -s -n 8; then exit 1 fi +# shellcheck disable=SC2016 { - sed -n "/^$1/p" "${work_dir}/build-list" - sed "/^$1/d" "${work_dir}/build-list" + printf 'UPDATE `build_assignments`' + mysql_join_build_assignments_package_sources + mysql_join_build_assignments_binary_packages + mysql_join_binary_packages_repositories + printf ' SET `build_assignments`.`priority`=(' + 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")' \ + "$(printf '%s' "$1" | base64 -w0)" + printf ' AND `repositories`.`name`="build-list";\n' } | \ - sponge "${work_dir}/build-list" + mysql_run_query # Remove the lock file |