summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-08-16 13:15:16 +0200
committerErich Eckner <git@eckner.net>2018-08-16 13:15:16 +0200
commit90bf8a6720b994e7d3571435e5a2ebc5cb967eb7 (patch)
tree5a4d3b0bcfb47325fbb3a4e004db0779576ff465 /bin
parentdc39be8fb80d82247f69968413def80b1056c6d1 (diff)
downloadbuilder-90bf8a6720b994e7d3571435e5a2ebc5cb967eb7.tar.xz
bin/bootstrap-mysql: `blacklist_packages`: black list based on _package_ architecture, not _repository_ architecture (the latter is "any" for the build-list - that is not, what we want)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bootstrap-mysql42
1 files changed, 27 insertions, 15 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index e76e839..5d31552 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -620,7 +620,6 @@ fi
printf 'DROP PROCEDURE IF EXISTS `blacklist_packages`//\n'
printf 'CREATE PROCEDURE `blacklist_packages`()\n'
printf 'blacklist_packages:BEGIN\n'
- printf 'DECLARE row_count_saved INT DEFAULT 0;\n'
for suffix in '' '_copy'; do
printf 'CREATE TEMPORARY TABLE `bl%s` (' \
@@ -635,14 +634,8 @@ fi
printf ' `architectures`.`id`,'
printf '`blacklist`.`pkgbase`'
printf ' FROM `blacklist`'
- printf ' JOIN `architectures` AS `bl_a`'
- printf ' ON `bl_a`.`name`=`blacklist`.`arch`'
- printf ' JOIN `architecture_compatibilities`'
- printf ' ON `architecture_compatibilities`.`runs_on`=`bl_a`.`id`'
- printf ' OR `bl_a`.`name`="any"'
printf ' JOIN `architectures`'
- printf ' ON `architectures`.`id`=`architecture_compatibilities`.`built_for`'
- printf ' WHERE `architectures`.`name`!="any";\n'
+ printf ' ON `architectures`.`name`=`blacklist`.`arch`;\n'
printf 'REPEAT\n'
@@ -653,24 +646,41 @@ fi
printf ' `bl`.`pkgbase`'
printf ' FROM `bl`;\n'
+ printf 'INSERT IGNORE INTO `bl`(`arch`,`pkgbase`)'
+ printf ' SELECT'
+ printf ' `architecture_compatibilities`.`built_for`,'
+ printf '`bl_copy`.`pkgbase`'
+ printf ' FROM `bl_copy`'
+ printf ' JOIN `architecture_compatibilities`'
+ printf ' ON ('
+ printf '`architecture_compatibilities`.`runs_on`=`bl_copy`.`arch`'
+ printf ' OR `bl_copy`.`arch`=%s' \
+ "${architecture_ids__any}"
+ printf ') AND `architecture_compatibilities`.`built_for`!=%s;\n' \
+ "${architecture_ids__any}"
+
+ printf 'DELETE FROM `bl_copy`;\n'
+ printf 'INSERT IGNORE INTO `bl_copy` (`arch`,`pkgbase`)'
+ printf ' SELECT'
+ printf ' `bl`.`arch`,'
+ printf ' `bl`.`pkgbase`'
+ printf ' FROM `bl`;\n'
+
printf 'INSERT IGNORE INTO `bl` (`arch`,`pkgbase`)'
printf ' SELECT'
- printf ' `a_r`.`architecture`,'
+ printf ' `a_bp`.`architecture`,'
printf '`a_ps`.`pkgbase`'
printf ' FROM `package_sources` AS `a_ps`'
mysql_join_package_sources_build_assignments 'a_ps' 'a_ba'
mysql_join_build_assignments_binary_packages 'a_ba' 'a_bp'
- mysql_join_binary_packages_binary_packages_in_repositories 'a_bp' 'a_bpir'
- mysql_join_binary_packages_in_repositories_repositories 'a_bpir' 'a_r'
- mysql_join_repositories_architectures 'a_r' 'a_ra'
+ mysql_join_binary_packages_architectures 'a_bp' 'a_a'
mysql_join_binary_packages_dependencies 'a_bp'
mysql_join_dependencies_dependency_types
printf ' AND (`dependency_types`.`relevant_for_building`'
printf ' OR `dependency_types`.`relevant_for_binary_packages`)'
- printf ' WHERE `a_ra`.`name`!="any"'
# TODO: This should be corrected at the root: automatic install targets, which are bogus should
# not be added in the first place - but how do we detect that? -> add exceptions!
- printf ' AND EXISTS ('
+ printf ' WHERE EXISTS ('
printf 'SELECT 1'
printf ' FROM `install_target_providers`'
printf ' WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`'
@@ -700,7 +710,9 @@ fi
printf ' ON `architectures`.`id`=`bl`.`arch`'
printf ';\n'
- printf 'DROP TEMPORARY TABLE `bl`;\n'
+ printf 'DROP TEMPORARY TABLE `bl%s`;\n' \
+ '' \
+ '_copy'
printf 'END\n'
printf '//\n'