From e40900974a9671651e0b18f4c9367e498157814c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 12 Mar 2018 11:40:07 +0100 Subject: bin/get-package-updates: only put packages on the deletion-list which are known in the database --- bin/get-package-updates | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 0276b7e..b48660d 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -99,7 +99,16 @@ fi # delete_package package # mark $package for deletion delete_package() { - echo "$1" >> \ + # shellcheck disable=SC2016 + { + printf 'SELECT DISTINCT `package_sources`.`pkgbase`' + printf ' FROM `package_sources`' + mysql_join_package_sources_build_assignments + mysql_join_build_assignments_binary_packages + printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \ + "$(printf '%s' "$1" | base64 -w0)" + } | \ + mysql_run_query >> \ "${work_dir}/deletion-list.new" sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new" find "${work_dir}/package-states" -maxdepth 1 -mindepth 1 -regextype grep \ -- cgit v1.2.3-70-g09d2