Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/db-update
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-15 13:37:38 +0100
committerErich Eckner <git@eckner.net>2019-01-15 13:37:38 +0100
commit8d58bec9248b49b33394ff1b59dce0d30a7607d7 (patch)
treec124a647e8352ab1578267355f7acf374965167b /bin/db-update
parent4b649666620ec0be7316bdee1f129765074813ba (diff)
bin/db-update -p: consider the stability of the repos
Diffstat (limited to 'bin/db-update')
-rwxr-xr-xbin/db-update24
1 files changed, 20 insertions, 4 deletions
diff --git a/bin/db-update b/bin/db-update
index c3e0c85..bcc5ccf 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -253,9 +253,12 @@ for source_stability in \
mysql_join_dependencies_versions '' 'd_v'
printf ' WHERE NOT EXISTS ('
printf 'SELECT 1 FROM `install_target_providers`'
- mysql_join_install_target_providers_binary_packages_in_repositories '' 'itp_bpir'
+ mysql_join_install_target_providers_binary_packages '' 'itp_bp'
+ mysql_join_binary_packages_binary_packages_in_repositories 'itp_bp' 'itp_bpir'
mysql_join_binary_packages_in_repositories_repositories 'itp_bpir' 'itp_r'
mysql_join_install_target_providers_versions '' 'itp_v'
+ printf ' JOIN `repository_stability_relations` AS `rsr_a`'
+ printf ' ON `rsr_a`.`more_stable`=`itp_r`.`stability`'
printf ' WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`'
printf ' AND'
mysql_query_ordering_correct \
@@ -263,9 +266,22 @@ for source_stability in \
'`itp_v`.`order`' \
'`dependencies`.`version_relation`'
printf ' AND `itp_r`.`architecture`=`old_r`.`architecture`'
- # TODO: also, we might want to consider the stability of the repo
- # For this, we would need to determine the least stable package
- # which is not less stable than the target repo
+ printf ' AND `rsr_a`.`less_stable`=`old_r`.`stability`'
+ # this is the least stable package of stability at least to_r.stability
+ printf ' AND NOT EXISTS ('
+ printf 'SELECT 1 FROM `binary_packages` AS `subst_bp`'
+ mysql_join_binary_packages_binary_packages_in_repositories 'subst_bp' 'subst_bpir'
+ mysql_join_binary_packages_in_repositories_repositories 'subst_bpir' 'subst_r'
+ printf ' JOIN `repository_stability_relations` AS `rsr_b`'
+ printf ' ON `rsr_b`.`less_stable`=`subst_r`.`stability`'
+ printf ' JOIN `repository_stability_relations` AS `rsr_c`'
+ printf ' ON `rsr_c`.`more_stable`=`subst_r`.`stability`'
+ printf ' WHERE `subst_bp`.`pkgname`=`itp_bp`.`pkgname`'
+ printf ' AND `subst_bp`.`id`!=`itp_bp`.`id`'
+ printf ' AND `rsr_b`.`more_stable`=`itp_r`.`stability`'
+ printf ' AND `rsr_c`.`less_stable`=`old_r`.`stability`'
+ printf ' AND `subst_r`.`architecture`=`itp_r`.`architecture`'
+ printf ')'
printf ');\n'
printf 'INSERT IGNORE INTO `moveable_bpir` (`id`,`to_repository`)'