From 84fc13f80e57ebea5715ac6e67502ba08efdcb02 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 25 Jan 2018 10:09:34 +0100 Subject: bin/return-assignment: remove loops containing the finished package from database --- bin/return-assignment | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index cd6d30e..9de8add 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -451,6 +451,16 @@ fi printf '%s' "${slave}" | \ base64 -w0 )" + printf 'CREATE TEMPORARY TABLE `loops_to_delete` (`loop` MEDIUMINT);\n' + printf 'INSERT INTO `loops_to_delete`' + printf ' SELECT `build_dependency_loops`.`loop` FROM `build_dependency_loops`' + printf ' JOIN `binary_packages` ON `binary_packages`.`build_assignment`=`build_dependency_loops`.`build_assignment`' + printf ' JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`' + printf ' WHERE NOT `repositories`.`name` = "build-list";\n' + printf 'DELETE FROM `build_dependency_loops` WHERE EXISTS (' + printf 'SELECT * FROM `loops_to_delete` WHERE `loops_to_delete`.`loop`=`build_dependency_loops`.`loop`' + printf ');\n' + printf 'DROP TABLE `loops_to_delete`;\n' } | \ ${mysql_command} rm -f \ -- cgit v1.2.3-70-g09d2