From d1bb013a5072bf9c9ef4846331e7331e3667b943 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 12 Feb 2018 22:31:49 +0100 Subject: bin/get-package-updates: delay update of build-list in database --- bin/get-package-updates | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index d752106..07e88a2 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -185,6 +185,17 @@ if ! flock -s ${block_flag} 8; then exit fi +# shellcheck disable=SC2016 +{ + printf 'DELETE FROM `binary_packages`' + printf ' WHERE `binary_packages`.`repository`=(' + printf 'SELECT `repositories`.`id`' + printf ' FROM `repositories`' + printf ' WHERE `repositories`.`name`="to-be-decided"' + printf ')' +} | \ + ${mysql_command} + echo 'Check modified packages from the last update, and put them to the build list.' # Check modified packages from the last update, and put them to the build list. @@ -573,6 +584,20 @@ else rm "${work_dir}/tsort.error" fi +# shellcheck disable=SC2016 +{ + printf 'UPDATE `binary_packages`' + printf ' JOIN `repositories` AS `from_repo`' + printf ' ON `binary_packages`.`repository`=`from_repo`.`id`' + printf ' SET `repository`=(' + printf 'SELECT `to_repo`.`id`' + printf ' FROM `repositories` AS `to_repo`' + printf ' WHERE `to_repo`.`name`="build-list"' + printf ')' + printf ' WHERE `from_repo`.`name`="to-be-decided";\n' +} | \ + ${mysql_command} + # update loop list in database mysql_find_build_assignment_loops -- cgit v1.2.3-70-g09d2