#!/bin/sh
# report about status of build master - according to mysql database
# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"
# shellcheck disable=SC2016
{
printf 'SELECT `build_slaves`.`name`,`build_slaves`.`operator`,`package_sources`.`pkgbase`,`build_slaves`.`last_connection`'
printf ' FROM `build_slaves`'
printf ' LEFT JOIN `build_assignments` ON'
printf ' `build_slaves`.`currently_building`=`build_assignments`.`id`'
printf ' LEFT JOIN `package_sources` ON'
printf ' `build_assignments`.`package_source`=`package_sources`.`id`'
printf ' ORDER BY `build_slaves`.`last_connection`'
} | \
${mysql_command} --html | \
sed '
s,,\0\n,g
' | \
sed '
\,$, {
s,
pkgbase | ,currently building | ,
y,_, ,
}
\,$, ! {
s,NULL | ,\ | ,
}
1 i list of build slaves
$ a
' | \
sponge "${webserver_directory}/build-slaves.html"
{
mysql_sanity_check || true
{
# shellcheck disable=SC2016
{
printf 'SELECT `package_sources`.`pkgbase`,`package_sources`.`git_revision`,`package_sources`.`mod_git_revision`,`upstream_repositories`.`name`'
printf ' FROM `package_sources`'
printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
'upstream_repositories' 'package_sources' 'upstream_package_repository' 'upstream_repositories' \
'build_assignments' 'build_assignments' 'package_source' 'package_sources' \
'binary_packages' 'binary_packages' 'build_assignment' 'build_assignments' \
'repositories' 'binary_packages' 'repository' 'repositories'
printf ' WHERE `repositories`.`name`="build-list"'
} | \
${mysql_command} --batch | \
sed '
1d
y/\t/ /
s/^/+ /
'
sed 's/^/- /' "${work_dir}/build-list"
} | \
sort -k2 -k1,1 | \
uniq -uf1
} | \
sed '
s,^-.*$,\0,
s,^+.*$,\0,
s/$/
/
1 i sanity of the buildmaster'"'"'s mysql database
$ a
' | \
sponge "${webserver_directory}/mysql-sanity.html"