summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/why-dont-you35
1 files changed, 27 insertions, 8 deletions
diff --git a/bin/why-dont-you b/bin/why-dont-you
index 170ee81..2ea27ab 100755
--- a/bin/why-dont-you
+++ b/bin/why-dont-you
@@ -283,15 +283,34 @@ case "${action}" in
printf ' AND NOT `binary_packages`.`has_issues`;\n'
printf 'INSERT IGNORE INTO `replaceable_bpir` (`id`,`replaced_by`)'
- printf ' SELECT `binary_packages_in_repositories`.`id`,`r_bpir`.`id`'
+ printf ' SELECT `r_bpir`.`id`,`m_bpir`.`id`'
printf ' FROM `moveable_bpir`'
- printf ' JOIN `binary_packages_in_repositories` AS `r_bpir`'
- printf ' ON `r_bpir`.`id`=`moveable_bpir`.`id`'
- mysql_join_binary_packages_in_repositories_binary_packages 'r_bpir' 'r_bp'
- printf ' JOIN `binary_packages`'
- printf ' ON `binary_packages`.`pkgname`=`r_bp`.`pkgname`'
- mysql_join_binary_packages_binary_packages_in_repositories
- printf ' WHERE `binary_packages_in_repositories`.`repository`=`moveable_bpir`.`to_repository`;\n'
+ printf ' JOIN `binary_packages_in_repositories` AS `m_bpir`'
+ printf ' ON `m_bpir`.`id`=`moveable_bpir`.`id`'
+ mysql_join_binary_packages_in_repositories_binary_packages 'm_bpir' 'm_bp'
+ printf ' JOIN `binary_packages` AS `r_bp`'
+ printf ' ON `r_bp`.`pkgname`=`m_bp`.`pkgname`'
+ mysql_join_binary_packages_binary_packages_in_repositories 'r_bp' 'r_bpir'
+ mysql_join_binary_packages_in_repositories_repositories 'r_bpir' 'r_r'
+ printf ' JOIN `repositories` AS `m_r`'
+ printf ' ON `m_r`.`id`=`moveable_bpir`.`to_repository`'
+ printf ' AND `m_r`.`architecture`=`r_r`.`architecture`'
+ printf ' JOIN `repository_stability_relations` AS `rsr`'
+ printf ' ON `rsr`.`more_stable`=`r_r`.`stability`'
+ printf ' AND `rsr`.`less_stable`=`m_r`.`stability`'
+ printf ' WHERE NOT EXISTS ('
+ printf 'SELECT 1 FROM `binary_packages_in_repositories` AS `subst_bpir`'
+ mysql_join_binary_packages_in_repositories_repositories 'subst_bpir' 'subst_r'
+ mysql_join_binary_packages_in_repositories_binary_packages 'subst_bpir' 'subst_bp'
+ printf ' JOIN `repository_stability_relations` AS `rsr_a`'
+ printf ' ON `rsr_a`.`more_stable`=`subst_r`.`stability`'
+ printf ' JOIN `repository_stability_relations` AS `rsr_b`'
+ printf ' ON `rsr_b`.`less_stable`=`subst_r`.`stability`'
+ printf ' WHERE `subst_bp`.`pkgname`=`r_bp`.`pkgname`'
+ printf ' AND `subst_bp`.`id`=`r_bp`.`id`'
+ printf ' AND `rsr_a`.`less_stable`=`m_r`.`stability`'
+ printf ' AND `rsr_b`.`more_stable`=`r_r`.`stability`'
+ printf ');\n'
# we generate a graph with bpir and it as knots