Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-25 13:40:36 +0200
committerErich Eckner <git@eckner.net>2018-05-25 13:40:36 +0200
commit8aeca7194277ab52126bb3358635743be2ed7e2d (patch)
tree9ddf06fcf276eeb6f563def98985826aaeb4ff14 /lib/mysql-functions
parent64277df1805bb165184267cab3668166da780b1e (diff)
lib/mysql-functions: make mysql_join_binary_packages_repositories and mysql_join_repositories_binary_packages obsolete
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions50
1 files changed, 31 insertions, 19 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 4a719a8..4ed10a2 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -259,6 +259,8 @@ mysql_generate_package_metadata() {
mysql_add_package_source "${pkgbase}" "${git_revision}" "${old_git_revision}" "${mod_git_revision}" "${repository}" "${temp_dir}/SRCINFO"
)
+ # TODO: architectures should be identified by id, not "(SELECT ...)"
+
# add the build assignment(s)
{
sed -n '
@@ -407,6 +409,7 @@ mysql_generate_package_metadata() {
# packages!)
printf '(SELECT `sub_pkgrel` FROM `binary_packages`'
mysql_join_binary_packages_architectures
+ mysql_join_binary_packages_binary_packages_in_repositories
printf ' WHERE'
printf ' `binary_packages`.`%s`=from_base64("%s") AND' \
'epoch' "${epoch}" \
@@ -415,7 +418,7 @@ mysql_generate_package_metadata() {
'pkgname' "${pkgname}"
printf ' `architectures`.`name`=from_base64("%s")' \
"${arch}"
- printf ' AND `binary_packages`.`repository` IN (%s,%s)),' \
+ printf ' AND `binary_packages_in_repository`.`repository` IN (%s,%s)),' \
"${repository_ids__any_build_list}" \
"${current_repository_id}"
# max(sub_pkgrel)+1
@@ -438,7 +441,7 @@ mysql_generate_package_metadata() {
printf ')'
printf ',0))'
)
- {
+ { # TODO: fix this mess, I'm tired
printf 'INSERT IGNORE INTO `binary_packages` ('
printf '`%s`,' \
'build_assignment' \
@@ -631,20 +634,23 @@ mysql_sanity_check() {
printf ' AND `ba_arch`.`name`="any";\n'
printf 'SELECT DISTINCT CONCAT("package multiple times on build list: ",`a`.`pkgname`)'
printf ' FROM `binary_packages` AS `a`'
- printf ' JOIN `binary_packages` AS `b`'
- printf ' ON `a`.`pkgname`=`b`.`pkgname`'
- printf ' AND `a`.`repository`=`b`.`repository`'
+ mysql_join_binary_packages_binary_packages_in_repositories 'a' 'a_bir'
+ printf ' JOIN `binary_packages_in_repositories` AS `b_bir`'
+ printf ' ON `b_bir`.`repository`=`a_bir`.`repository`'
+ mysql_join_binary_packages_in_repositories_binary_packages 'b_bir' 'b'
+ printf ' AND `a`.`pkgname`=`b`.`pkgname`'
printf ' AND `a`.`id`!=`b`.`id`'
- mysql_join_binary_packages_repositories 'a'
- printf ' WHERE `repositories`.`name`="build-list";\n'
+ printf ' WHERE `a_bir`.`repository`=%s;\n' \
+ "${repository_ids__any_build_list}"
printf 'SELECT DISTINCT CONCAT("\\"split-package with differing sub_pkgrels on the build-list: ",`a`.`pkgname`)'
printf ' FROM `binary_packages` AS `a`'
printf ' JOIN `binary_packages` AS `b` ON `a`.`build_assignment`=`b`.`build_assignment`'
- mysql_join_binary_packages_repositories 'a' 'arep'
- mysql_join_binary_packages_repositories 'b' 'brep'
+ mysql_join_binary_packages_binary_packages_in_repositories 'a' 'a_bir'
+ mysql_join_binary_packages_binary_packages_in_repositories 'b' 'b_bir'
printf ' WHERE `a`.`sub_pkgrel`!=`b`.`sub_pkgrel`'
- printf ' AND `%srep`.`name`="build-list"' \
- 'a' 'b'
+ printf ' AND `%s_bir`.`repository`=%s' \
+ 'a' "${repository_ids__any_build_list}" \
+ 'b' "${repository_ids__any_build_list}"
printf ';\n'
} | \
mysql_run_query | \
@@ -677,7 +683,8 @@ mysql_sanity_check() {
printf 'SELECT `r_a`.`name`,`repositories`.`name`,`pkgname`,`epoch`,`pkgver`,`pkgrel`,`sub_pkgrel`,`architectures`.`name`'
printf ' FROM `binary_packages`'
mysql_join_binary_packages_architectures
- mysql_join_binary_packages_repositories
+ mysql_join_binary_packages_binary_packages_in_repositories
+ mysql_join_binary_packages_in_repositories_repositories
mysql_join_repositories_architectures '' 'r_a'
printf ' WHERE `repositories`.`is_on_master_mirror`'
} | \
@@ -708,8 +715,10 @@ mysql_find_build_assignment_loops() {
mysql_join_dependencies_install_target_providers
mysql_join_install_target_providers_binary_packages '' 'packages_dependency'
mysql_join_dependencies_binary_packages '' 'packages_dependent'
- mysql_join_binary_packages_repositories 'packages_dependency' 'repositories_dependency'
- mysql_join_binary_packages_repositories 'packages_dependent' 'repositories_dependent'
+ mysql_join_binary_packages_binary_packages_in_repositories 'packages_dependency' 'packages_in_repository_dependency'
+ mysql_join_binary_packages_in_repositories_repositories 'packages_in_repository_dependency' 'repositories_dependency'
+ mysql_join_binary_packages_binary_packages_in_repositories 'packages_dependent' 'packages_in_repository_dependent'
+ mysql_join_binary_packages_in_repositories_repositories 'packages_in_repository_dependent' 'repositories_dependent'
printf ' WHERE `repositories_dependent`.`name`="build-list" AND `repositories_dependency`.`name`="build-list"'
} | \
mysql_run_query | \
@@ -763,7 +772,8 @@ mysql_cleanup() {
printf '`binary_packages` '
fi
printf 'FROM `binary_packages`'
- mysql_join_binary_packages_repositories
+ mysql_join_binary_packages_binary_packages_in_repositories
+ mysql_join_binary_packages_in_repositories_repositories
printf ' WHERE `repositories`.`name`="to-be-decided";\n'
# remove build_assignments w/o binary_package
printf '%s FROM `build_assignments` ' \
@@ -797,7 +807,8 @@ mysql_cleanup() {
else
printf 'SELECT COUNT(DISTINCT `build_slaves`.`id`) FROM `repositories`'
fi
- mysql_join_repositories_binary_packages
+ mysql_join_repositories_binary_packages_in_repositories
+ mysql_join_binary_packages_in_repositories_binary_packages
printf ' AND `repositories`.`name`="build-list"'
printf ' RIGHT'
mysql_join_binary_packages_build_slaves
@@ -838,11 +849,13 @@ mysql_cleanup() {
mysql_query_has_pending_dependencies() {
printf 'EXISTS ('
printf 'SELECT * FROM `binary_packages` as `to_dos`'
- mysql_join_binary_packages_repositories 'to_dos' 'to_do_repos'
+ mysql_join_binary_packages_binary_packages_in_repositories 'to_dos' 'to_dos_pir'
+ mysql_join_binary_packages_in_repositories_repositories 'to_dos_pir' 'to_do_repos'
mysql_join_binary_packages_dependencies 'to_dos'
mysql_join_dependencies_install_target_providers
mysql_join_install_target_providers_binary_packages '' 'bin_deps'
- mysql_join_binary_packages_repositories 'bin_deps' 'dep_repos'
+ mysql_join_binary_packages_binary_packages_in_repositories 'bin_deps' 'binir_deps'
+ mysql_join_binary_packages_in_repositories_repositories 'binir_deps' 'dep_repos'
printf ' WHERE'
printf ' `%s`.`name`="build-list" AND' \
'dep_repos' 'to_do_repos'
@@ -945,7 +958,6 @@ for link in \
'allowed_email_actions:gpg_key:gpg_keys' \
\
'binary_packages:architecture:architectures' \
- 'binary_packages:repository:repositories' \
'binary_packages:build_assignment:build_assignments' \
\
'binary_packages_in_repositories:package:binary_packages' \