summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-22 20:14:36 +0100
committerErich Eckner <git@eckner.net>2018-01-22 20:14:36 +0100
commitb1bf479514f9b796169df90f6b8097b91600620a (patch)
tree7eede28c8e230a49f9b105a0812319bd4b27b00e
parent59103fabbb2583e627452750f7043633d21a7b45 (diff)
downloadbuilder-b1bf479514f9b796169df90f6b8097b91600620a.tar.xz
bin/get-package-updates: mark packages as on deletion-list in mysql database
-rwxr-xr-xbin/get-package-updates14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 2d113f1..cea1ec1 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -90,6 +90,20 @@ delete_package() {
echo "$1" >> \
"${work_dir}/deletion-list.new"
sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new"
+ # shellcheck disable=SC2016
+ {
+ printf 'UPDATE `binary_packages`'
+ printf ' JOIN `%s` ON `%s`.`id`=`binary_packages`.`%s`' \
+ 'repositories' 'repositories' 'repository' \
+ 'build_assignments' 'build_assignments' 'build_assignment'
+ printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \
+ 'package_sources' 'package_sources' 'build_assignments' 'package_source'
+ printf ' WHERE `repositories`.`name`="build-list"'
+ printf ' AND `package_sources`.`pkgbase`=from_base64("%s")' \
+ "$(printf '%s' "$1" | base64 -w0)"
+ printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list");'
+ } | \
+ ${mysql_command}
}
# create tmp_dir and trap