From 1606ed8bef2e8976c2b847678e8a77af99541383 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 7 Jun 2018 10:04:50 +0200 Subject: lib/mysql-functions: stricter sanity check: two packages with the same name in equally-stable, non-virtual repositories are forbidden --- lib/mysql-functions | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/mysql-functions b/lib/mysql-functions index 14dc3d6..ea3cdfb 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -12,14 +12,6 @@ fi # TODO: replace most/all insert-select queries by separate select and insert # queries -# TODO: normally operate on `binary_packages_in_repositories` instead of -# `binary_packages` - -# TODO: consider `binary_packages` as cache of -# `binary_packages_in_repositories` (e.g. delete, when no -# `binary_packages_in_repositories` needs `binary_packages` anymore, -# otherwise let them untouched) - # base64_encode_each encode each line of stdin with base64 base64_encode_each() { @@ -632,16 +624,21 @@ mysql_sanity_check() { mysql_join_build_assignments_architectures '' 'ba_arch' printf ' WHERE `bp_arch`.`name`!="any"' printf ' AND `ba_arch`.`name`="any";\n' - printf 'SELECT DISTINCT CONCAT("package multiple times in the same repository: ",`repositories`.`name`,"/",`a`.`pkgname`)' + printf 'SELECT DISTINCT CONCAT("package multiple times in equally stable repositories: {",`a_r`.`name`,",",`b_r`.`name`,"}/",`a`.`pkgname`)' printf ' FROM `binary_packages` AS `a`' mysql_join_binary_packages_binary_packages_in_repositories 'a' 'a_bir' - mysql_join_binary_packages_in_repositories_repositories 'a_bir' - mysql_join_repositories_binary_packages_in_repositories '' 'b_bir' + mysql_join_binary_packages_in_repositories_repositories 'a_bir' 'a_r' + printf ' JOIN `repositories` AS `a_r`' + printf ' ON `a_r`.`stability`=`b_r`.`stability`' + printf ' AND `a_r`.`architecture`=`b_r`.`architecture`' + mysql_join_repositories_binary_packages_in_repositories 'b_r' 'b_bir' mysql_join_binary_packages_in_repositories_binary_packages 'b_bir' 'b' printf ' AND `a`.`pkgname`=`b`.`pkgname`' - printf ' AND `a`.`architecture`=`b`.`architecture`' printf ' AND `a`.`id`!=`b`.`id`' - printf ' WHERE `repositories`.`id` NOT IN (%s,%s);\n' \ + printf ' WHERE `a_r`.`id` NOT IN (%s,%s)' \ + "${repository_ids__any_deletion_list}" \ + "${repository_ids__any_to_be_decided}" + printf ' AND `b_r`.`id` NOT IN (%s,%s);\n' \ "${repository_ids__any_deletion_list}" \ "${repository_ids__any_to_be_decided}" printf 'SELECT DISTINCT CONCAT("split-package with differing sub_pkgrels on the build-list: ",`a`.`pkgname`)' -- cgit v1.2.3-70-g09d2