From c3fe3412a9257822aab29a0196f4281e9b75bf45 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 20 Feb 2020 14:34:54 +0100 Subject: bin/get-package-updates: use new mysql_query_delete_packages() function --- bin/get-package-updates | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3