From b8fbd4f85572ba7d7bc565198c0d06200d52626c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 13 Sep 2018 14:56:28 +0200 Subject: lib/mysql-functions: mysql_find_build_assignment_loops() should ignore makedepends iff there is already a built version available --- lib/mysql-functions | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/mysql-functions b/lib/mysql-functions index 5b83b34..7cafb79 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -682,10 +682,14 @@ mysql_sanity_check() { ) } +# mysql_find_build_assignment_loops +# recreate the `build_dependency_loops` table mysql_find_build_assignment_loops() { new_loops=$( { - printf 'SELECT DISTINCT `packages_dependency`.`build_assignment`,`packages_dependent`.`build_assignment`' + printf 'SELECT DISTINCT' + printf ' `packages_dependency`.`build_assignment`,' + printf '`packages_dependent`.`build_assignment`' printf ' FROM `dependencies`' mysql_join_dependencies_dependency_types mysql_join_dependencies_install_target_providers_with_versions @@ -697,7 +701,23 @@ mysql_find_build_assignment_loops() { "${repository_ids__any_build_list}" printf ' AND `packages_in_repository_dependency`.`repository`=%s' \ "${repository_ids__any_build_list}" - printf ' AND `dependency_types`.`relevant_for_building`;\n' + printf ' AND `dependency_types`.`relevant_for_building`' + printf ' AND (' + printf '`dependency_types`.`relevant_for_binary_packages`' + printf ' OR NOT EXISTS (' + printf 'SELECT 1 FROM `binary_packages_in_repositories` AS `subst_bpir`' + mysql_join_binary_packages_in_repositories_repositories 'subst_bpir' 'subst_r' + printf ' AND `subst_r`.`is_on_master_mirror`' + mysql_join_binary_packages_in_repositories_install_target_providers 'subst_bpir' 'subst_itp' + mysql_join_install_target_providers_versions 'subst_itp' 'subst_itp_v' + printf ' WHERE `subst_itp`.`install_target`=`dependencies`.`depending_on`' + printf ' AND ' + mysql_query_ordering_correct \ + '`dependencies_versions`.`order`' \ + '`subst_itp_v`.`order`' \ + '`dependencies`.`version_relation`' + printf ')' + printf ');\n' } | \ mysql_run_query | \ tr '\t' ' ' | \ -- cgit v1.2.3-70-g09d2