summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-25 10:09:34 +0100
committerErich Eckner <git@eckner.net>2018-01-25 10:09:34 +0100
commit84fc13f80e57ebea5715ac6e67502ba08efdcb02 (patch)
treec796989977e4fefdcab700fc7d8f8391de80a762 /bin/return-assignment
parent1b964f215c3b93c9c970137f8883b8a8c79d4319 (diff)
downloadbuilder-84fc13f80e57ebea5715ac6e67502ba08efdcb02.tar.xz
bin/return-assignment: remove loops containing the finished package from database
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment10
1 files changed, 10 insertions, 0 deletions
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 \