From cddb2a6b04c1425953b4082bb230fa6be8ca7449 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 4 Sep 2018 08:48:45 +0200 Subject: lib/mysql-functions: increase sub_pkgrel iff binary_package existed already off the build-list --- lib/mysql-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/mysql-functions b/lib/mysql-functions index 920a825..c975fdc 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -384,7 +384,7 @@ mysql_generate_package_metadata() { "${temp_dir}/database-input" printf 'SET @sub_pkgrel=(' - printf 'SELECT MAX(`binary_packages`.`sub_pkgrel`)' + printf 'SELECT IFNULL(MAX(`binary_packages`.`sub_pkgrel`)+1,0)' printf ' FROM `links`' printf ' JOIN `architectures`' printf ' ON `architectures`.`name`=`links`.`architecture`' @@ -394,6 +394,11 @@ mysql_generate_package_metadata() { 'epoch' 'epoch' \ 'pkgver' 'pkgver' \ 'pkgrel' 'pkgrel' + printf ' LEFT' + mysql_join_binary_packages_binary_packages_in_repositories + printf ' WHERE `binary_packages_in_repositories`.`repository`!=%s' \ + "${repository_ids__any_build_list}" + printf ' OR `binary_packages_in_repositories`.`repository` IS NULL' printf ');\n' printf 'INSERT IGNORE INTO `build_assignments` (' -- cgit v1.2.3-70-g09d2