Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-06 13:48:56 +0100
committerErich Eckner <git@eckner.net>2018-02-06 13:48:56 +0100
commit86823d203d23536386d7c01356e2a5a6df810adf (patch)
treee38f0a57d53d1d4d83236a893533391872775124 /bin/get-package-updates
parent3e99365e5fc1c608e60c0465eba520806060413b (diff)
bin/get-package-updates: build-list packages should be "deleted" immediately
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index f451991..180e0ae 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -104,15 +104,26 @@ delete_package() {
sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new"
# shellcheck disable=SC2016
{
+ # packages from the build-list go straight to the deletion-list
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 ' SET `binary_packages`.`is_to_be_deleted`=1'
+ printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list")'
printf ' WHERE `repositories`.`name`="build-list"'
- printf ' AND `package_sources`.`pkgbase`=from_base64("%s");' \
+ printf ' AND `package_sources`.`pkgbase`=from_base64("%s");\n' \
+ "$(printf '%s' "$1" | base64 -w0)"
+ # other packages are marked as `is_to_be_deleted`
+ 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 ' SET `binary_packages`.`is_to_be_deleted`=1'
+ printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s");' \
"$(printf '%s' "$1" | base64 -w0)"
} | \
${mysql_command}