Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/why-dont-you
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-16 11:14:03 +0100
committerErich Eckner <git@eckner.net>2018-02-16 11:14:03 +0100
commitd2e0ef2a558e27e07150f239d91e4c29ce822426 (patch)
treef11a28ba418ecd8fae69fa7fcd3bd6a2623a8dfd /bin/why-dont-you
parentd7a7e5cebf55c13ab3522e6ec17e11cba878da73 (diff)
bin/mysql-functions: mysql_join_*_* new
Diffstat (limited to 'bin/why-dont-you')
-rwxr-xr-xbin/why-dont-you23
1 files changed, 10 insertions, 13 deletions
diff --git a/bin/why-dont-you b/bin/why-dont-you
index e9922b7..d95f2a7 100755
--- a/bin/why-dont-you
+++ b/bin/why-dont-you
@@ -57,10 +57,9 @@ case "${action}" in
# package_source, build_assignment, binary_package, repostory
printf 'SELECT DISTINCT `tb_ps`.`pkgbase`,`tb_bin`.`id` AS `bin_id`,`tb_ba`.`id` AS `ba_id`,`tb_ba`.`is_blocked`,`tb_ba`.`is_broken`'
printf ' FROM `package_sources` AS `tb_ps`'
- printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
- 'build_assignments` AS `tb_ba' 'tb_ba' 'package_source' 'tb_ps' \
- 'binary_packages` AS `tb_bin' 'tb_bin' 'build_assignment' 'tb_ba' \
- 'repositories` AS `tb_rep' 'tb_bin' 'repository' 'tb_rep'
+ mysql_join_package_sources_build_assignments 'tb_ps' 'tb_ba'
+ mysql_join_build_assignments_binary_packages 'tb_ba' 'tb_bin'
+ mysql_join_binary_packages_repositories 'tb_bin' 'tb_rep'
printf ' WHERE `tb_rep`.`name`="build-list"'
printf ') AS `to_build`'
printf ' ON `to_build`.`pkgbase`=`pkgbases`.`pkgbase`'
@@ -70,16 +69,14 @@ case "${action}" in
# potential dependencies
printf 'SELECT DISTINCT `dep_ps`.`pkgbase`,`dependencies`.`dependent`'
printf ' FROM `package_sources` AS `dep_ps`'
- printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
- 'build_assignments` AS `dep_ba' 'dep_ba' 'package_source' 'dep_ps' \
- 'binary_packages` AS `dep_bin' 'dep_bin' 'build_assignment' 'dep_ba' \
- 'repositories` AS `dep_rep' 'dep_bin' 'repository' 'dep_rep' \
- 'install_target_providers' 'install_target_providers' 'package' 'dep_bin'
- # starting from the line above, we have some additional joins,
+ mysql_join_package_sources_build_assignments 'dep_ps' 'dep_ba'
+ mysql_join_build_assignments_binary_packages 'dep_ba' 'dep_bin'
+ mysql_join_binary_packages_repositories 'dep_bin' 'dep_rep'
+ # now we have some (=3) additional joins,
# because we are interested in dependency relations to `to_build`
- printf ' JOIN `dependencies` ON `install_target_providers`.`install_target`=`dependencies`.`depending_on`'
- printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
- 'dependency_types' 'dependencies' 'dependency_type' 'dependency_types'
+ mysql_join_binary_packages_install_target_providers 'dep_bin'
+ mysql_join_install_target_providers_dependencies
+ mysql_join_dependencies_dependency_types
printf ' WHERE `dep_rep`.`name`="build-list"'
printf ' AND `dependency_types`.`relevant_for_building`'
printf ') AS `deps`'