Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/bootstrap-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-26 15:20:54 +0100
committerErich Eckner <git@eckner.net>2018-02-26 15:20:54 +0100
commit5a72e06a2ef65e8cf2991938896bc520ae2b5c4a (patch)
tree83c185d49b743d4cd0d91c6f3f963c3d86a35c0b /bin/bootstrap-mysql
parent0ed8a1ed58785d3b0fcb21cf3f911d3d1111424a (diff)
bin/bootstrap-mysql: calculate_dependencies_of_package_upto_first_built_one new
Diffstat (limited to 'bin/bootstrap-mysql')
-rwxr-xr-xbin/bootstrap-mysql34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index 275764b..a172d82 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -262,6 +262,40 @@ if [ ! "$1" = 'slim' ]; then
printf '//\n'
printf 'DELIMITER ;\n'
+ # calculate_dependencies_of_package_upto_first_built_one
+ # save binary packages (only their `id`) in `relevant_binary_packages` and `relevant_binary_packages_copy`
+ printf 'DROP PROCEDURE IF EXISTS calculate_dependencies_of_package_upto_first_built_one;\n'
+ printf 'DELIMITER //\n'
+ printf 'CREATE PROCEDURE calculate_dependencies_of_package_upto_first_built_one(IN `target_pkgbase` VARCHAR(64))\n'
+ printf 'BEGIN\n'
+ printf 'INSERT IGNORE INTO `relevant_binary_packages` (`id`)'
+ printf ' SELECT `binary_packages`.`id`'
+ printf ' FROM `binary_packages`'
+ mysql_join_binary_packages_repositories
+ printf ' AND `repositories`.`name`="build-list"'
+ mysql_join_binary_packages_build_assignments
+ mysql_join_build_assignments_package_sources
+ printf ' WHERE `package_sources`.`pkgbase`=`target_pkgbase`;\n'
+ printf 'REPEAT\n'
+ printf 'INSERT IGNORE INTO `relevant_binary_packages_copy` (`id`)'
+ printf ' SELECT `relevant_binary_packages`.`id` FROM `relevant_binary_packages`;\n'
+ printf 'INSERT IGNORE INTO `relevant_binary_packages` (`id`)'
+ printf ' SELECT `install_target_providers`.`package`'
+ printf ' FROM `relevant_binary_packages_copy`'
+ printf ' JOIN `binary_packages` ON `relevant_binary_packages_copy`.`id`=`binary_packages`.`id`'
+ mysql_join_binary_packages_repositories
+ printf ' AND `repositories`.`name`="build-list"'
+ mysql_join_binary_packages_dependencies
+ mysql_join_dependencies_dependency_types
+ printf ' AND `dependency_types`.`relevant_for_building`'
+ mysql_join_dependencies_install_target_providers
+ printf ';\n'
+ printf 'UNTIL ROW_COUNT()=0\n'
+ printf 'END REPEAT;\n'
+ printf 'END\n'
+ printf '//\n'
+ printf 'DELIMITER ;\n'
+
printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \
'CREATE ROUTINE' 'buildmaster.*' \
'CREATE TEMPORARY TABLES' 'buildmaster.*' \