Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-23 15:06:31 +0200
committerErich Eckner <git@eckner.net>2018-07-23 15:06:31 +0200
commit96773fdedcae8354aa720c63fb289140d482529d (patch)
treebaa606aae5fb7abd22c42815d35e8053c942ba1a
parent4726ed62362267d10ea571da4f7ab75b0859b78d (diff)
do not address deletion-list directly, but rather by its stability "forbidden"
-rwxr-xr-xbin/delete-packages25
-rwxr-xr-xbin/get-package-updates17
-rwxr-xr-xlib/mysql-functions12
3 files changed, 35 insertions, 19 deletions
diff --git a/bin/delete-packages b/bin/delete-packages
index 58d15e3..5109e4c 100755
--- a/bin/delete-packages
+++ b/bin/delete-packages
@@ -363,11 +363,26 @@ fi
printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `bpir_to_delete`;\n' \
"${tmp_dir}/package-in-repository-ids"
+ printf 'UPDATE `binary_packages_in_repositories`'
+ printf ' JOIN `bpir_to_delete`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ mysql_join_binary_packages_in_repositories_repositories
+ printf ' JOIN `repositories` AS `d_r`'
+ printf ' ON `d_r`.`stability`=%s' \
+ "${repository_stability_ids__forbidden}"
+ printf ' AND `d_r`.`architecture`=`repositories`.`architecture`'
+ printf ' SET `binary_packages_in_repositories`.`repository`=`d_r`.`id`'
+ # shellcheck disable=SC2154
+ printf ' WHERE `repositories`.`stability`!=%s;\n' \
+ "${repository_stability_ids__standalone}"
+
printf 'DELETE `binary_packages_in_repositories`'
printf ' FROM `binary_packages_in_repositories`'
- printf ' JOIN `bpir_to_delete` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ printf ' JOIN `bpir_to_delete`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
mysql_join_binary_packages_in_repositories_repositories
- printf ' WHERE `repositories`.`name`="build-support";\n'
+ printf ' WHERE `repositories`.`stability`!=%s;\n' \
+ "${repository_stability_ids__forbidden}"
printf 'DELETE `binary_packages`'
printf ' FROM `binary_packages`'
@@ -375,12 +390,6 @@ fi
printf 'SELECT 1 FROM `binary_packages_in_repositories`'
printf ' WHERE `binary_packages_in_repositories`.`package`=`binary_packages`.`id`'
printf ');\n'
-
- printf 'UPDATE `binary_packages_in_repositories`'
- printf ' JOIN `bpir_to_delete` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
- # shellcheck disable=SC2154
- printf ' SET `binary_packages_in_repositories`.`repository`=%s;\n' \
- "${repository_ids__any_deletion_list}"
} | \
mysql_run_query
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 1c0ac5e..575a96e 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -121,10 +121,15 @@ delete_package() {
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_build_assignments
mysql_join_build_assignments_package_sources
- printf ' SET '
+ mysql_join_binary_packages_in_repositories_repositories
+ printf ' JOIN `repositories` AS `d_r`'
# shellcheck disable=SC2154
+ printf ' ON `d_r`.`stability`=%s' \
+ "${repository_stability_ids__forbidden}"
+ printf ' AND `d_r`.`architecture`=`repositories`.`architecture`'
+ printf ' SET '
printf '`binary_packages_in_repositories`.`%s`=%s,' \
- 'repository' "${repository_ids__any_deletion_list}" \
+ 'repository' '`d_r`.`id`' \
'is_to_be_deleted' '1' \
'last_moved' 'NOW()' | \
sed 's/,$//'
@@ -379,14 +384,16 @@ trigger_rebuild_on_any_file_sed_expression=$(
mysql_join_binary_packages_build_assignments
mysql_join_build_assignments_package_sources
mysql_join_binary_packages_binary_packages_in_repositories
+ mysql_join_binary_packages_in_repositories_repositories
printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \
"$(
printf '%s' "${package}" | \
base64 -w0
)"
- printf ' AND `binary_packages_in_repositories`.`repository` IN (%s,%s);\n' \
- "${repository_ids__any_build_list}" \
- "${repository_ids__any_deletion_list}"
+ # shellcheck disable=SC2154
+ printf ' AND `repositories`.`stability` IN (%s,%s);\n' \
+ "${repository_stability_ids__unbuilt}" \
+ "${repository_stability_ids__forbidden}"
# remove is-to-be-deleted marker from old binary packages
printf 'UPDATE `binary_packages_in_repositories`'
mysql_join_binary_packages_in_repositories_binary_packages
diff --git a/lib/mysql-functions b/lib/mysql-functions
index a984508..bb58ca0 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -633,12 +633,12 @@ mysql_sanity_check() {
mysql_join_binary_packages_in_repositories_binary_packages 'b_bir' 'b'
printf ' AND `a`.`pkgname`=`b`.`pkgname`'
printf ' AND `a`.`id`!=`b`.`id`'
- printf ' WHERE `a_r`.`id` NOT IN (%s,%s)' \
- "${repository_ids__any_deletion_list}" \
- "${repository_ids__any_to_be_decided}"
- printf ' AND `b_r`.`id` NOT IN (%s,%s);\n' \
- "${repository_ids__any_deletion_list}" \
- "${repository_ids__any_to_be_decided}"
+ printf ' WHERE `a_r`.`stability` NOT IN (%s,%s)' \
+ "${repository_stability_ids__forbidden}" \
+ "${repository_stability_ids__virtual}"
+ printf ' AND `b_r`.`stability` NOT IN (%s,%s);\n' \
+ "${repository_stability_ids__forbidden}" \
+ "${repository_stability_ids__virtual}"
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`'