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:
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}