From e4d15e3848eb16803e462ed0050978efde4939c0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 26 Feb 2020 13:25:29 +0100 Subject: lib/mysql-functions: mysql_join_install_target_providers_dependencies_with_versions() and mysql_join_dependencies_install_target_providers_with_versions() can now use pre-joined versions --- lib/mysql-functions | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/mysql-functions b/lib/mysql-functions index 9f0ed94..b44a229 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1402,27 +1402,36 @@ done # mysql_join_install_target_providers_dependencies_with_versions() and # mysql_join_dependencies_install_target_providers_with_versions() also -# join via `versions` +# join via `versions`, optional 3rd argument cancels 1st version-join, +# optional 4th argument cancels 2nd version-join mysql_join_install_target_providers_dependencies_with_versions() { 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" + if [ -z "$3" ]; then + mysql_join_install_target_providers_versions "$1" "${1:-install_target_providers}_versions" + fi + if [ -z "$4" ]; then + mysql_join_dependencies_versions "$2" "${2:-dependencies}_versions" + fi printf ' AND ' mysql_query_ordering_correct \ - '`'"${2:-dependencies}_versions"'`.`order`' \ - '`'"${1:-install_target_providers}_versions"'`.`order`' \ + '`'"${4:-${2:-dependencies}_versions}"'`.`order`' \ + '`'"${3:-${1:-install_target_providers}_versions}"'`.`order`' \ '`'"${2:-dependencies}"'`.`version_relation`' } 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" + if [ -z "$4" ]; then + mysql_join_install_target_providers_versions "$2" "${2:-install_target_providers}_versions" + fi + if [ -z "$3" ]; then + mysql_join_dependencies_versions "$1" "${1:-dependencies}_versions" + fi printf ' AND ' mysql_query_ordering_correct \ - '`'"${1:-dependencies}_versions"'`.`order`' \ - '`'"${2:-install_target_providers}_versions"'`.`order`' \ + '`'"${3:-${1:-dependencies}_versions}"'`.`order`' \ + '`'"${4:-${2:-install_target_providers}_versions}"'`.`order`' \ '`'"${1:-dependencies}"'`.`version_relation`' } -- cgit v1.2.3-70-g09d2