From 76b43092f15494a0c7b26cf13a625893fc077044 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 29 May 2018 16:54:48 +0200 Subject: bin/copy-to-build-support: keep binary_packages_in_repositories up-to-date --- bin/copy-to-build-support | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/copy-to-build-support b/bin/copy-to-build-support index 2838432..ef08d7d 100755 --- a/bin/copy-to-build-support +++ b/bin/copy-to-build-support @@ -70,6 +70,7 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT export TMPDIR="${tmp_dir}" +mysql_retrieve_repository_ids to_copy='build_assignment epoch pkgver pkgrel sub_pkgrel has_issues is_tested pkgname architecture' sed -n ' s/.\+/\0 \0/ @@ -139,7 +140,9 @@ sed -n ' printf ',`%s`' ${to_copy} printf ')' printf ' SELECT' - printf ' (SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="build-support")' + # shellcheck disable=SC2154 + printf ' %s' \ + "${repository_ids__i686_build_support}" # shellcheck disable=SC2086 printf ',`binary_packages`.`%s`' ${to_copy} printf ' FROM `binary_packages`' @@ -147,6 +150,10 @@ sed -n ' printf ' WHERE' printf ' `binary_packages`.`id`=%s;\n' \ "${id}" + printf 'INSERT IGNORE INTO `binary_packages_in_repositories`' + printf ' (`repository`,`package`)' + printf ' SELECT %s,LAST_INSERT_ID();\n' \ + "${repository_ids__i686_build_support}" } >> \ "${tmp_dir}/mysql-command" done -- cgit v1.2.3-70-g09d2