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-03-09 16:09:53 +0100
committerErich Eckner <git@eckner.net>2018-03-09 16:09:53 +0100
commit9ede9a11566506384d5ce13736a9153313a14535 (patch)
treeb754134eeb351b7cac6365f878ee2f520da4a6ba /bin/get-package-updates
parent2acef10964ec3f7027981f45a072fd5e4aab3722 (diff)
bin/get-package-updates: do not remove to-be-decided packages (of other running instance!) if we cannot acquire a lock
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates21
1 files changed, 2 insertions, 19 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index ffcb078..5285646 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -16,9 +16,6 @@
# TODO: keep database clean in case of abort
-# TODO: It seems, updating present build assignments in the database is broken
-# ... they seem to get deleted
-
# shellcheck disable=SC2016
usage() {
>&2 echo ''
@@ -136,22 +133,6 @@ delete_package() {
fi
}
-# create tmp_dir and trap
-clean_up() {
- rm -rf --one-file-system "${tmp_dir}"
- # shellcheck disable=SC2016
- {
- printf 'DELETE FROM `binary_packages`'
- printf ' WHERE `binary_packages`.`repository`=('
- printf 'SELECT `repositories`.`id` FROM `repositories`'
- printf ' WHERE `repositories`.`name`="to-be-decided"'
- printf ');\n'
- } | \
- mysql_run_query
-}
-tmp_dir=$(mktemp -d 'tmp.get-package-updates.XXXXXXXXXX' --tmpdir)
-trap 'clean_up' EXIT
-
# Update git repositories (official packages, community packages and the repository of package customizations).
for repo in ${repo_names}; do
@@ -202,6 +183,8 @@ if ! flock -s ${block_flag} 8; then
exit
fi
+trap mysql_cleanup EXIT
+
# shellcheck disable=SC2119
mysql_cleanup