index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-09-04 15:16:01 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-04 15:16:01 +0200 |
commit | c32924e6f226f1e961b0cf3576c04c639e1637bb (patch) | |
tree | 4c1850049d51942555669234f07ebdfedf9391a7 /lib/mysql-functions | |
parent | 122575e94563705ec0b7227fb6afbd53f5244405 (diff) |
-rwxr-xr-x | lib/mysql-functions | 55 |
diff --git a/lib/mysql-functions b/lib/mysql-functions index 2537311..45bf3df 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -676,7 +676,7 @@ mysql_find_build_assignment_loops() { printf 'SELECT DISTINCT `packages_dependency`.`build_assignment`,`packages_dependent`.`build_assignment`' printf ' FROM `dependencies`' mysql_join_dependencies_dependency_types - mysql_join_dependencies_install_target_providers + mysql_join_dependencies_install_target_providers_with_versions mysql_join_install_target_providers_binary_packages '' 'packages_dependency' mysql_join_dependencies_binary_packages '' 'packages_dependent' mysql_join_binary_packages_binary_packages_in_repositories 'packages_dependency' 'packages_in_repository_dependency' @@ -820,7 +820,7 @@ mysql_query_has_pending_dependencies() { mysql_join_binary_packages_in_repositories_binary_packages 'todos_bpir' 'todos' mysql_join_binary_packages_dependencies 'todos' 'l_deps' mysql_join_dependencies_dependency_types 'l_deps' 'l_dep_ts' - mysql_join_dependencies_install_target_providers 'l_deps' 'l_itps' + mysql_join_dependencies_install_target_providers_with_versions 'l_deps' 'l_itps' mysql_join_install_target_providers_binary_packages 'l_itps' 'deps' mysql_join_binary_packages_binary_packages_in_repositories 'deps' 'deps_bpir' printf ' WHERE' @@ -927,6 +927,7 @@ for link in \ 'dependencies:dependent:binary_packages' \ 'dependencies:dependent package:binary_packages_in_repositories' \ 'dependencies:dependency_type:dependency_types' \ + 'dependencies:version:versions' \ \ 'email_log:action:email_actions' \ 'email_log:gpg_key:gpg_keys' \ @@ -941,6 +942,7 @@ for link in \ 'install_target_providers:package package:binary_packages_in_repositories' \ 'install_target_providers:install_target:install_targets' \ 'install_target_providers:install_target depending_on:dependencies' \ + 'install_target_providers:version:versions' \ \ 'package_sources:upstream_package_repository:upstream_repositories' \ \ @@ -974,6 +976,55 @@ for link in \ mysql_join__generic "${table_b}" "${column_b}" "${table_a}" "${column_a}" done +# mysql_join_install_target_providers_dependencies_with_versions() and +# mysql_join_dependencies_install_target_providers_with_versions() also +# join via `versions` +mysql_join_install_target_providers_dependencies_with_versions() { + local relation + mysql_join_install_target_providers_dependencies "$1" "$2" + mysql_join_install_target_providers_versions "$1" "${1:-install_target_providers}_versions" + mysql_join_dependencies_versions "$2" "${2:-dependencies}_versions" + printf ' AND (' + for relation in '<' '<=' '>' '>=' '='; do + printf '(' + printf '`%s`.`version_relation`="%s"' \ + "${2:-dependencies}" \ + "${relation}" + printf ' AND `%s`.`order`%s`%s`.`order`' \ + "${1:-install_target_providers}_versions" \ + "${relation}" \ + "${2:-dependencies}_versions" + printf ') OR ' + done | \ + sed ' + s/ OR $// + ' + printf ')' +} + +mysql_join_dependencies_install_target_providers_with_versions() { + local relation + mysql_join_dependencies_install_target_providers "$1" "$2" + mysql_join_install_target_providers_versions "$2" "${2:-install_target_providers}_versions" + mysql_join_dependencies_versions "$1" "${1:-dependencies}_versions" + printf ' AND (' + for relation in '<' '<=' '>' '>=' '='; do + printf '(' + printf '`%s`.`version_relation`="%s"' \ + "${1:-dependencies}" \ + "${relation}" + printf ' AND `%s`.`order`%s`%s`.`order`' \ + "${2:-install_target_providers}_versions" \ + "${relation}" \ + "${1:-dependencies}_versions" + printf ') OR ' + done | \ + sed ' + s/ OR $// + ' + printf ')' +} + # mysql_retrieve_static_information # retrieve some static information from the database: # - ids of architectures -> $architecture_ids__$arch |