Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-20 14:34:54 +0100
committerErich Eckner <git@eckner.net>2020-02-20 14:34:54 +0100
commitc3fe3412a9257822aab29a0196f4281e9b75bf45 (patch)
tree3d7196e5c606a60227324846c0b9b88bba156f18 /bin
parent04e3a5b7aac60de8860768239451829c99dd6df3 (diff)
bin/get-package-updates: use new mysql_query_delete_packages() function
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-package-updates46
1 files changed, 7 insertions, 39 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index a5ad82e..353a581 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -417,45 +417,13 @@ echo 'Check modified packages from the last update, and put them to the build li
# shellcheck disable=SC2016
{
# delete old binary packages which are not yet built or on the
- # deletion list and their build_assignment, if it only builds
- # deleted packages (first try deleting the build assignment,
- # otherwise we loose the handle on it!)
- for with_ba in true false; do
- printf 'DELETE '
- if "${with_ba}"; then
- # try to delete build-assignment, too
- printf '`build_assignments`,'
- fi
- printf '`binary_packages`,`binary_packages_in_repositories`'
- printf ' FROM `binary_packages`'
- mysql_join_binary_packages_build_assignments
- mysql_join_build_assignments_package_sources
- if "${with_ba}"; then
- # some package not unbuilt or not on the deletion-list?
- mysql_join_binary_packages_binary_packages_in_repositories '' 'keep_bpir'
- printf ' LEFT'
- mysql_join_binary_packages_in_repositories_repositories 'keep_bpir' 'keep_r'
- # shellcheck disable=SC2154
- printf ' AND `keep_r`.`stability` NOT IN (%s,%s)' \
- "${repository_stability_ids__unbuilt}" \
- "${repository_stability_ids__forbidden}"
- fi
- 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
- )"
- if "${with_ba}"; then
- # only if all packages unbuilt or on the deletion-list
- printf ' AND `keep_r`.`id` IS NULL'
- fi
- # shellcheck disable=SC2154
- printf ' AND `repositories`.`stability` IN (%s,%s);\n' \
- "${repository_stability_ids__unbuilt}" \
- "${repository_stability_ids__forbidden}"
- done
+ # deletion list
+ mysql_query_delete_packages \
+ '`package_sources`.`pkgbase`=from_base64("'"$(
+ printf '%s' "${package}" | \
+ base64 -w0
+ )"'")' \
+ '`repositories`.`stability` IN ('"${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