From c4bb6a739aa4887525535cdbe38edfb93aac2edb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 08:42:57 +0100 Subject: bin/get-package-updates: remove older versions of new build assignments from build- and deletion-list --- bin/get-package-updates | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 5b8bcea..7c57e03 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -286,6 +286,24 @@ done | \ echo "${package} ${git_revision} ${new_repo_revisions__archlinux32} ${repository}" >> \ "${work_dir}/build-list.new" sed -i "/^$(str_to_regex "${package}")\$/d" "${work_dir}/deletion-list.new" + # shellcheck disable=SC2016 + { + # delete old build assignment and associated binary packages + # which are not yet build or on the deletion list + printf 'DELETE `build_assignments`,`binary_pacakges`' + printf ' FROM `binary_packages`' + printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ + 'build_assignments' 'build_assignments' 'binary_packages' 'build_assignment' \ + 'package_sources' 'package_sources' 'build_assignments' 'package_source' \ + 'repositories' 'repositories' 'binary_packages' 'repository' + printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \ + "$( + printf '%s' "${package}" | \ + base64 -w0 + )" + printf ' AND (`repositories`.`name`="build-list" OR `repositories`.`name`="deletion-list");\n' + } | \ + ${mysql_command} mysql_generate_package_metadata "${package}" "${git_revision}" "${new_repo_revisions__archlinux32}" "${repository}" continue fi -- cgit v1.2.3-70-g09d2