summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-23 08:42:57 +0100
committerErich Eckner <git@eckner.net>2018-01-23 08:42:57 +0100
commitc4bb6a739aa4887525535cdbe38edfb93aac2edb (patch)
tree3d45030fae9192d070de28cf3e6cc7e500e52d34 /bin/get-package-updates
parent9843dd27008a7ed749c4feffab76c7688035d49c (diff)
downloadbuilder-c4bb6a739aa4887525535cdbe38edfb93aac2edb.tar.xz
bin/get-package-updates: remove older versions of new build assignments from build- and deletion-list
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