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:
Diffstat (limited to 'bin/bootstrap-mysql')
-rwxr-xr-xbin/bootstrap-mysql29
1 files changed, 20 insertions, 9 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index eb6462c..1e6bc89 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -109,18 +109,29 @@ fi
printf ' JOIN `binary_packages_in_repositories` AS `m_bpir` ON `m_bpir`.`id`=`moveable_bpir`.`id`'
mysql_join_binary_packages_in_repositories_binary_packages 'm_bpir' 'm_bp'
mysql_join_binary_packages_in_repositories_repositories 'm_bpir' 'm_from_r'
- mysql_join_binary_packages_build_assignments 'm_bp' 'm_ba'
- mysql_join_build_assignments_package_sources 'm_ba' 'm_ps'
- mysql_join_package_sources_upstream_repositories 'm_ps' 'm_ur'
- mysql_join_upstream_repositories_repository_moves 'm_ur'
- printf ' AND `repository_moves`.`from_repository`=`m_from_r`.`id`'
- # in its target repository
- printf ' JOIN `repositories` AS `m_to_r` ON `repository_moves`.`to_repository`=`m_to_r`.`id`'
- printf ' JOIN `repositories` AS `r_r` ON `r_r`.`stability`=`m_to_r`.`stability`'
+ # in all repositories more stable than its target repository
+ printf ' JOIN `repositories` AS `m_to_r` ON `moveable_bpir`.`to_repository`=`m_to_r`.`id`'
+ printf ' JOIN `repository_stability_relations` AS `rsr_a`'
+ printf ' ON `rsr_a`.`less_stable`=`m_to_r`.`stability`'
+ printf ' JOIN `repositories` AS `r_r`'
+ printf ' AND `rsr_a`.`more_stable`=`r_r`.`stability`'
+ printf ' AND `r_r`.`architecture`=`m_to_r`.`architecture`'
mysql_join_repositories_binary_packages_in_repositories 'r_r' 'r_bpir'
mysql_join_binary_packages_in_repositories_binary_packages 'r_bpir' 'r_bp'
# all packages with identical names
- printf ' AND `r_bp`.`pkgname`=`m_bp`.`pkgname`;\n'
+ printf ' AND `r_bp`.`pkgname`=`m_bp`.`pkgname`'
+ # but only the least stable of equally named packages is considered
+ printf ' WHERE NOT EXISTS ('
+ printf 'SELECT 1'
+ printf ' FROM `binary_packages_in_repositories` AS `sup_bpir`'
+ mysql_join_binary_packages_in_repositories_binary_packages 'sup_bpir' 'sup_bp'
+ mysql_join_binary_packages_in_repositories_repositories 'sup_bp' 'sup_r'
+ printf ' JOIN `repository_stability_relations` AS `rsr_b`'
+ printf ' ON `rsr_b`.`less_stable`=`sup_r`.`stability`'
+ printf ' WHERE `sup_bp`.`pkgname`=`m_bp`.`pkgname`'
+ printf ' AND `sup_r`.`architecture`=`m_to_r`.`architecture`'
+ printf ' AND `rsr_b`.`more_stable`=`r_r`.`stability`'
+ printf ');\n'
# now we delete all unreplaceable and unmoveable packages from the respective
# list until no further changes are required
printf 'REPEAT\n'