diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 15:03:27 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 15:03:27 +0200 |
commit | 9eb1cd7b9403533c4b60ecfbbbf00a08c211059a (patch) | |
tree | 024459abc4017b4c574bf6e5cd9d2f4df2b95f26 /db-update | |
parent | 388d629327d97e8d15a7a67cc87ae36edfe2f385 (diff) | |
download | dbscripts-9eb1cd7b9403533c4b60ecfbbbf00a08c211059a.tar.gz dbscripts-9eb1cd7b9403533c4b60ecfbbbf00a08c211059a.tar.xz |
Move common function to db-functions
db-functions now sets an individual $WORKDIR and implements trap functinos that
remove locks on exit or error. There are new functions to lock and unlock the running script.
misc-scripts/ftpdir-cleanup was renamed to ftpdir-cleanup-repo as the cron-job had the same name.
Script names have to be unique when using db-functions.
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -33,26 +33,6 @@ if [ ! -d $stagedir ]; then exit 1 fi -cleanup() { - trap '' 0 2 - repo_unlock $reponame $current_arch - rm -rf "$WORKDIR" - [ "$1" ] && exit $1 -} - -ctrl_c() { - echo "Interrupted" >&2 - cleanup 1 -} - -die() { - echo "$*" >&2 - cleanup 1 -} - -trap ctrl_c 2 -trap cleanup 0 - echo -n "Updating $reponame..." # Remove any package from $stagedir that is already in the FTP repository @@ -238,6 +218,4 @@ fi echo 'done' -trap '' 0 2 -rm -rf $WORKDIR # vim: set ts=4 sw=4 noet ft=sh: |