summaryrefslogtreecommitdiff
path: root/bin/build-master-status-from-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-09 21:26:56 +0100
committerErich Eckner <git@eckner.net>2018-02-09 21:26:56 +0100
commitb66e5381ea809a44773a52aeb76f11a04e359271 (patch)
tree4957db8263df8e61e19fa92061d67d47d17814bf /bin/build-master-status-from-mysql
parent5e3a4034972f57ddbc3738104541a81290298b09 (diff)
downloadbuilder-b66e5381ea809a44773a52aeb76f11a04e359271.tar.xz
bin/build-master-status-from-mysql: check locked packages, too
Diffstat (limited to 'bin/build-master-status-from-mysql')
-rwxr-xr-xbin/build-master-status-from-mysql29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql
index 16afb9f..d1ee9ff 100755
--- a/bin/build-master-status-from-mysql
+++ b/bin/build-master-status-from-mysql
@@ -38,6 +38,31 @@ fi
sort "${work_dir}/build-list" > \
"${tmp_dir}/build-list.file"
+# shellcheck disable=SC2016
+{
+ printf 'SELECT '
+ printf '`package_sources`.`%s`,' \
+ 'pkgbase' 'git_revision' 'mod_git_revision'
+ printf '`upstream_repositories`.`name`'
+ printf ' FROM `build_slaves`'
+ printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \
+ 'build_assignments' 'build_assignments' 'build_slaves' 'currently_building' \
+ 'package_sources' 'package_sources' 'build_assignments' 'package_source' \
+ 'upstream_repositories' 'upstream_repositories' 'package_sources' 'upstream_package_repository'
+} | \
+ ${mysql_command} --raw --batch | \
+ sed '
+ 1d
+ y/\t/ /
+ ' | \
+ sort > \
+ "${tmp_dir}/locked.mysql"
+find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 -name '*.locked' -printf '%f\n' | \
+ sed '
+ s/\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)\.[^.]\+$/ \1 \2 \3/
+ ' | \
+ sort > \
+ "${tmp_dir}/locked.file"
# shellcheck disable=SC2016
{
@@ -193,6 +218,10 @@ find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 \
"${tmp_dir}/build-dependencies.file"
{
+ diff -u \
+ "${tmp_dir}/locked.file" \
+ "${tmp_dir}/locked.mysql" || \
+ true
mysql_sanity_check || true
diff -u \
"${tmp_dir}/build-list.file" \