summaryrefslogtreecommitdiff
path: root/bin/bootstrap-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-01 10:28:39 +0200
committerErich Eckner <git@eckner.net>2018-06-01 10:28:39 +0200
commitb7e9c6ac4a637e551ae5869f4b0aed40cac7629a (patch)
treeb984a266a5488e3ab88d6b8861bfd44a2a6a9603 /bin/bootstrap-mysql
parent35829c844687d874f5e6ab0f4807261bf5b95268 (diff)
downloadbuilder-b7e9c6ac4a637e551ae5869f4b0aed40cac7629a.tar.xz
bin/bootstrap-mysql: add TODO, remove deprecated functions
Diffstat (limited to 'bin/bootstrap-mysql')
-rwxr-xr-xbin/bootstrap-mysql79
1 files changed, 2 insertions, 77 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index 84f8874..a8bd1be 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -23,83 +23,6 @@ fi
#shellcheck disable=SC2016
{
- # show_broken_packages_and_dependencies
- # gives a list of broken packages and their dependencies if they're
- # still on the build- or deletion-list
- printf 'DROP PROCEDURE IF EXISTS show_broken_packages_and_dependencies;\n'
- printf 'DELIMITER //\n'
- printf 'CREATE PROCEDURE show_broken_packages_and_dependencies()\n'
- printf 'BEGIN\n'
- printf 'CREATE TEMPORARY TABLE `%s` (`id` BIGINT, UNIQUE KEY (`id`));\n' \
- 'broken_packages_and_dependencies' 'broken_packages_and_dependencies_old'
- printf 'INSERT IGNORE INTO `broken_packages_and_dependencies` (`id`)'
- printf ' SELECT `build_assignments`.`id`'
- printf ' FROM `binary_packages`'
- mysql_join_binary_packages_build_assignments
- printf ' AND `build_assignments`.`is_broken`'
- mysql_join_binary_packages_binary_packages_in_repositories
- mysql_join_binary_packages_in_repositories_repositories
- printf ' AND `repositories`.`name`="build-list";\n'
- printf 'REPEAT\n'
- printf 'INSERT IGNORE INTO `broken_packages_and_dependencies_old` (`id`)'
- printf ' SELECT `broken_packages_and_dependencies`.`id` FROM `broken_packages_and_dependencies`;\n'
- printf 'INSERT IGNORE INTO `broken_packages_and_dependencies` (`id`)'
- printf ' SELECT `new_bp`.`build_assignment`'
- printf ' FROM `broken_packages_and_dependencies_old`'
- mysql_join_build_assignments_binary_packages 'broken_packages_and_dependencies_old' 'old_bp'
- mysql_join_binary_packages_dependencies 'old_bp'
- mysql_join_dependencies_dependency_types
- printf ' AND `dependency_types`.`relevant_for_building`'
- mysql_join_dependencies_install_target_providers
- mysql_join_install_target_providers_binary_packages '' 'new_bp'
- mysql_join_binary_packages_binary_packages_in_repositories 'new_bp' 'new_bpir'
- mysql_join_binary_packages_in_repositories_repositories 'new_bpir' 'new_repo'
- printf ' AND `new_repo`.`name` IN ("build-list","deletion-list");\n'
- printf 'UNTIL ROW_COUNT()=0\n'
- printf 'END REPEAT;\n'
- printf 'SELECT '
- mysql_query_select_pkgbase_and_revision
- printf ' JOIN `broken_packages_and_dependencies` ON `broken_packages_and_dependencies`.`id`=`build_assignments`.`id`;\n'
- printf 'END\n'
- 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_binary_packages_in_repositories
- mysql_join_binary_packages_in_repositories_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_binary_packages_in_repositories
- mysql_join_binary_packages_in_repositories_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'
-
# calculate_maximal_moveable_set
# stores results in `moveable_binary_packages` and `replaced_binary_packages`
# Give a maximal list of packages to be moved, while implementing the
@@ -117,6 +40,8 @@ fi
# a-1 in [core], then this will be "replaced" by a-2 on a system
# running on [testing] repositories.
+ # TODO: operate on binary_packages_in_repositories instead of binary_packages
+
printf 'DROP PROCEDURE IF EXISTS calculate_maximal_moveable_set;\n'
printf 'DELIMITER //\n'
printf 'CREATE PROCEDURE calculate_maximal_moveable_set(IN `from_stability` VARCHAR(32))\n'