From 610d38fb5510f0a415003701850d19d073ab162c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 8 Feb 2018 23:29:04 +0100 Subject: bin/mysql-functions: even more tests --- bin/mysql-functions | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/mysql-functions b/bin/mysql-functions index c57b5ae..64f1915 100755 --- a/bin/mysql-functions +++ b/bin/mysql-functions @@ -623,18 +623,28 @@ mysql_generate_package_metadata() { mysql_sanity_check() { { - printf 'SELECT `binary_packages`.`pkgname`' + printf 'SELECT CONCAT("\\"any\\" build-assignment building \\"",`bp_arch`.`name`,"\\" binary package: ",`binary_packages`.`pkgname`)' printf ' FROM `binary_packages`' printf ' JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`' printf ' JOIN `architectures` as `bp_arch` ON `binary_packages`.`architecture`=`bp_arch`.`id`' printf ' JOIN `architectures` as `ba_arch` ON `build_assignments`.`architecture`=`ba_arch`.`id`' printf ' WHERE `bp_arch`.`name`!="any"' - printf ' AND `ba_arch`.`name`="any"' + printf ' AND `ba_arch`.`name`="any";\n' + printf 'SELECT DISTINCT CONCAT("package multiple times on build list: ",`a`.`pkgname`)' + printf ' FROM `binary_packages` AS `a`' + printf ' JOIN `binary_packages` AS `b`' + printf ' ON `a`.`pkgname`=`b`.`pkgname`' + printf ' AND `a`.`repository`=`b`.`repository`' + printf ' AND `a`.`id`!=`b`.`id`' + printf ' JOIN `repositories`' + printf ' ON `a`.`repository`=`repositories`.`id`' + printf ' WHERE `repositories`.`name`="build-list";\n' } | \ ${mysql_command} --raw --batch | \ sed ' - 1d - s/^/"any"-build assignment building non-"any" binary package: / + /^CONCAT("/d + s,^,, + s,$,, ' ( # new shell is intentional temp_dir=$(mktemp -d 'tmp.mysql-functions.mysql_sanity_check.XXXXXXXXXX' --tmpdir) -- cgit v1.2.3-70-g09d2