summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-04 08:48:45 +0200
committerErich Eckner <git@eckner.net>2018-09-04 08:48:45 +0200
commitcddb2a6b04c1425953b4082bb230fa6be8ca7449 (patch)
treef40c4733f95cf0ce388c6018a66ee38edf264b82
parent46c409b56549b5888737f5c52bbae90ba815df78 (diff)
downloadbuilder-cddb2a6b04c1425953b4082bb230fa6be8ca7449.tar.xz
lib/mysql-functions: increase sub_pkgrel iff binary_package existed already off the build-list
-rwxr-xr-xlib/mysql-functions7
1 files changed, 6 insertions, 1 deletions
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` ('