Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'