summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates18
1 files changed, 18 insertions, 0 deletions
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