Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/bootstrap-mysql2
-rwxr-xr-xbin/build-master-status2
-rwxr-xr-xbin/seed-build-list4
-rwxr-xr-xbin/why-dont-you2
-rwxr-xr-xlib/mysql-functions55
5 files changed, 58 insertions, 7 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index 68a90ff..f130a9a 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -233,7 +233,7 @@ fi
printf ' JOIN `binary_packages_in_repositories` AS `repl_bpir` ON `repl_bpir`.`id`=`replaced_bpir`.`id`'
mysql_join_binary_packages_in_repositories_install_target_providers 'repl_bpir'
mysql_join_binary_packages_in_repositories_repositories 'repl_bpir' 'repl_r'
- mysql_join_install_target_providers_dependencies
+ mysql_join_install_target_providers_dependencies_with_versions
printf ' AND NOT EXISTS ('
# dependencies of replaced packages don't matter
printf 'SELECT 1 FROM `replaced_bpir_copy`'
diff --git a/bin/build-master-status b/bin/build-master-status
index 369b792..5786fb8 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -232,7 +232,7 @@ if [ ! -s "${work_dir}/build-master-sanity" ]; then
printf 'SELECT 1 FROM `dependencies`'
mysql_join_dependencies_dependency_types
printf ' AND `dependency_types`.`relevant_for_building`'
- mysql_join_dependencies_install_target_providers
+ mysql_join_dependencies_install_target_providers_with_versions
mysql_join_install_target_providers_binary_packages '' 'prov_bp'
mysql_join_binary_packages_binary_packages_in_repositories 'prov_bp' 'prov_bpir'
printf ' WHERE `prov_bpir`.`repository`=%s' \
diff --git a/bin/seed-build-list b/bin/seed-build-list
index 0e8c425..a96b822 100755
--- a/bin/seed-build-list
+++ b/bin/seed-build-list
@@ -344,7 +344,7 @@ fi
mysql_join_binary_packages_dependencies
mysql_join_dependencies_dependency_types
printf ' AND `dependency_types`.`relevant_for_binary_packages`'
- mysql_join_dependencies_install_target_providers '' 'itp_dummy'
+ mysql_join_dependencies_install_target_providers_with_versions '' 'itp_dummy'
# some dependencies are not provided by the least stable packages
printf ' WHERE NOT EXISTS ('
printf 'SELECT 1 FROM `install_target_providers`'
@@ -484,7 +484,7 @@ fi
printf '`dependency_types`.`relevant_for_building`'
printf ' OR `dependency_types`.`relevant_for_binary_packages`'
printf ')'
- mysql_join_dependencies_install_target_providers '' 'it_dummy'
+ mysql_join_dependencies_install_target_providers_with_versions '' 'it_dummy'
printf ' WHERE `dependencies`.`dependent`=`binary_packages`.`id`'
printf ' AND NOT EXISTS ('
printf 'SELECT 1 FROM `install_target_providers`'
diff --git a/bin/why-dont-you b/bin/why-dont-you
index 2ea27ab..5c6e08a 100755
--- a/bin/why-dont-you
+++ b/bin/why-dont-you
@@ -80,7 +80,7 @@ case "${action}" in
# now we have some (=3) additional joins,
# because we are interested in dependency relations to `to_build`
mysql_join_binary_packages_install_target_providers 'dep_bin'
- mysql_join_install_target_providers_dependencies
+ mysql_join_install_target_providers_dependencies_with_versions
mysql_join_dependencies_dependency_types
printf ' WHERE `dep_rep`.`name`="build-list"'
printf ' AND `dependency_types`.`relevant_for_building`'
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 2537311..45bf3df 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -676,7 +676,7 @@ mysql_find_build_assignment_loops() {
printf 'SELECT DISTINCT `packages_dependency`.`build_assignment`,`packages_dependent`.`build_assignment`'
printf ' FROM `dependencies`'
mysql_join_dependencies_dependency_types
- mysql_join_dependencies_install_target_providers
+ mysql_join_dependencies_install_target_providers_with_versions
mysql_join_install_target_providers_binary_packages '' 'packages_dependency'
mysql_join_dependencies_binary_packages '' 'packages_dependent'
mysql_join_binary_packages_binary_packages_in_repositories 'packages_dependency' 'packages_in_repository_dependency'
@@ -820,7 +820,7 @@ mysql_query_has_pending_dependencies() {
mysql_join_binary_packages_in_repositories_binary_packages 'todos_bpir' 'todos'
mysql_join_binary_packages_dependencies 'todos' 'l_deps'
mysql_join_dependencies_dependency_types 'l_deps' 'l_dep_ts'
- mysql_join_dependencies_install_target_providers 'l_deps' 'l_itps'
+ mysql_join_dependencies_install_target_providers_with_versions 'l_deps' 'l_itps'
mysql_join_install_target_providers_binary_packages 'l_itps' 'deps'
mysql_join_binary_packages_binary_packages_in_repositories 'deps' 'deps_bpir'
printf ' WHERE'
@@ -927,6 +927,7 @@ for link in \
'dependencies:dependent:binary_packages' \
'dependencies:dependent package:binary_packages_in_repositories' \
'dependencies:dependency_type:dependency_types' \
+ 'dependencies:version:versions' \
\
'email_log:action:email_actions' \
'email_log:gpg_key:gpg_keys' \
@@ -941,6 +942,7 @@ for link in \
'install_target_providers:package package:binary_packages_in_repositories' \
'install_target_providers:install_target:install_targets' \
'install_target_providers:install_target depending_on:dependencies' \
+ 'install_target_providers:version:versions' \
\
'package_sources:upstream_package_repository:upstream_repositories' \
\
@@ -974,6 +976,55 @@ for link in \
mysql_join__generic "${table_b}" "${column_b}" "${table_a}" "${column_a}"
done
+# mysql_join_install_target_providers_dependencies_with_versions() and
+# mysql_join_dependencies_install_target_providers_with_versions() also
+# join via `versions`
+mysql_join_install_target_providers_dependencies_with_versions() {
+ local relation
+ mysql_join_install_target_providers_dependencies "$1" "$2"
+ mysql_join_install_target_providers_versions "$1" "${1:-install_target_providers}_versions"
+ mysql_join_dependencies_versions "$2" "${2:-dependencies}_versions"
+ printf ' AND ('
+ for relation in '<' '<=' '>' '>=' '='; do
+ printf '('
+ printf '`%s`.`version_relation`="%s"' \
+ "${2:-dependencies}" \
+ "${relation}"
+ printf ' AND `%s`.`order`%s`%s`.`order`' \
+ "${1:-install_target_providers}_versions" \
+ "${relation}" \
+ "${2:-dependencies}_versions"
+ printf ') OR '
+ done | \
+ sed '
+ s/ OR $//
+ '
+ printf ')'
+}
+
+mysql_join_dependencies_install_target_providers_with_versions() {
+ local relation
+ mysql_join_dependencies_install_target_providers "$1" "$2"
+ mysql_join_install_target_providers_versions "$2" "${2:-install_target_providers}_versions"
+ mysql_join_dependencies_versions "$1" "${1:-dependencies}_versions"
+ printf ' AND ('
+ for relation in '<' '<=' '>' '>=' '='; do
+ printf '('
+ printf '`%s`.`version_relation`="%s"' \
+ "${1:-dependencies}" \
+ "${relation}"
+ printf ' AND `%s`.`order`%s`%s`.`order`' \
+ "${2:-install_target_providers}_versions" \
+ "${relation}" \
+ "${1:-dependencies}_versions"
+ printf ') OR '
+ done | \
+ sed '
+ s/ OR $//
+ '
+ printf ')'
+}
+
# mysql_retrieve_static_information
# retrieve some static information from the database:
# - ids of architectures -> $architecture_ids__$arch