summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-07 10:04:50 +0200
committerErich Eckner <git@eckner.net>2018-06-07 10:04:50 +0200
commit1606ed8bef2e8976c2b847678e8a77af99541383 (patch)
treecd0b967a39afc30ab22ea306c79ff8ab788ed060 /lib/mysql-functions
parent7c0cce2e3c809ba9b4f5c27ba4bcbff0c1123d77 (diff)
downloadbuilder-1606ed8bef2e8976c2b847678e8a77af99541383.tar.xz
lib/mysql-functions: stricter sanity check: two packages with the same name in equally-stable, non-virtual repositories are forbidden
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions23
1 files 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`)'