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-updates57
1 files changed, 30 insertions, 27 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 533f14f..465f896 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -9,8 +9,6 @@
# TODO: Find out, why sometimes package updates are missed.
-# TODO: test_exclusion does not yet cooperate with the database
-
# TODO: read information from database
# TODO: correctly handle if pkgbase of a split package is renamed, e.g.:
@@ -104,31 +102,36 @@ delete_package() {
echo "$1" >> \
"${work_dir}/deletion-list.new"
sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new"
- # shellcheck disable=SC2016
- {
- # packages from the build-list/to-be-decided 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`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list")'
- printf ' WHERE `repositories`.`name` in ("build-list","to-be-decided")'
- 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}
+ # TODO: Once we want to rely on the database for test_exclusion, we
+ # need to run the command below unconditionally, but with some
+ # changes, so we can easily revert.
+ if [ -z "${test_exclusion}" ]; then
+ # shellcheck disable=SC2016
+ {
+ # packages from the build-list/to-be-decided 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`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list")'
+ printf ' WHERE `repositories`.`name` in ("build-list","to-be-decided")'
+ 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}
+ fi
}
# create tmp_dir and trap