diff options
author | Erich Eckner <git@eckner.net> | 2018-05-29 16:54:48 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-05-29 16:54:48 +0200 |
commit | 76b43092f15494a0c7b26cf13a625893fc077044 (patch) | |
tree | efcdb6571e1f843e32c96825a9170a2ecb131b53 /bin | |
parent | 812a74361742c3bf9c3d03362e63e18d9fb5b4c0 (diff) | |
download | builder-76b43092f15494a0c7b26cf13a625893fc077044.tar.xz |
bin/copy-to-build-support: keep binary_packages_in_repositories up-to-date
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/copy-to-build-support | 9 |
1 files changed, 8 insertions, 1 deletions
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 |