diff options
author | Erich Eckner <git@eckner.net> | 2018-05-15 10:30:11 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-05-15 10:30:11 +0200 |
commit | 1eb61f044cb3a58534257b046ed1020dc8573b5a (patch) | |
tree | 37ca90aee72975c53fba3e6e7022bc7be8c86ba1 /lib | |
parent | e39e8c4831f6016344de8448b193c16dad68ba8b (diff) | |
download | builder-1eb61f044cb3a58534257b046ed1020dc8573b5a.tar.xz |
lib/mysql-functions: mysql_retrieve_repository_ids() new
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/mysql-functions | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions index 55e994e..ef70098 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1049,3 +1049,21 @@ mysql_show_binary_packages_in_repositories_issues() { } | \ mysql_run_query } + +# mysql_retrieve_repository_ids +# retrieve the ids of all known repositories into $repository_ids__$arch_$repo +mysql_retrieve_repository_ids() { + eval "$( + { + printf 'SELECT CONCAT(' + printf '"repository_ids__",' + printf '`architectures`.`name`,"_",' + printf '`repositories`.`name`,"=",' + printf '`repositories`.`id`' + printf ') FROM `repositories`' + mysql_join_repositories_architectures + } | \ + mysql_run_query | \ + tr -- '-' '_' + )" +} |