summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-18 20:58:12 +0100
committerErich Eckner <git@eckner.net>2018-02-18 20:58:12 +0100
commit1dca50324cdeb4c88460cd59b5684705c8e5b70a (patch)
tree29d928a3e68f62f614aa59b03f94a524cbe50114 /bin
parentee2db3dfee0b1aebbadbc9d54281b69e226c4cef (diff)
downloadbuilder-1dca50324cdeb4c88460cd59b5684705c8e5b70a.tar.xz
bin/mysql-functions: remove binary_packages from to-be-decided, style
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mysql-functions23
1 files changed, 17 insertions, 6 deletions
diff --git a/bin/mysql-functions b/bin/mysql-functions
index 5850ab5..185d9a9 100755
--- a/bin/mysql-functions
+++ b/bin/mysql-functions
@@ -771,6 +771,15 @@ mysql_cleanup() {
exit 2
fi
{
+ # remove to-be-decided binary_packages
+ printf '%s ' \
+ "${operator}"
+ if [ "${operator}" = 'DELETE' ]; then
+ printf '`binary_packages` '
+ fi
+ printf 'FROM `binary_packages`'
+ mysql_join_binary_packages_repositories
+ printf ' WHERE `repositories`.`name`="to-be-decided";\n'
# remove dependencies w/o binary_package or install_target
printf '%s FROM `dependencies` ' \
"${operator}"
@@ -804,13 +813,15 @@ mysql_cleanup() {
printf 'WHERE `binary_packages`.`build_assignment`=`build_assignments`.`id`'
printf ');\n'
# remove failed_builds with unbroken build_assignments
- printf '%s FROM `failed_builds` ' \
+ printf '%s ' \
"${operator}"
- printf 'WHERE ('
- printf 'SELECT NOT `build_assignments`.`is_broken`'
- printf ' FROM `build_assignments` '
- printf ' WHERE `failed_builds`.`build_assignment`=`build_assignments`.`id`'
- printf ');\n'
+ if [ "${operator}" = 'DELETE' ]; then
+ printf '`failed_builds` '
+ fi
+ printf 'FROM `failed_builds` '
+ mysql_join_failed_builds_build_assignments
+ printf 'WHERE NOT `build_assignments`.`is_broken`'
+ printf ';\n'
# remove failed_builds w/o build_assignment
printf '%s FROM `failed_builds` ' \
"${operator}"