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 /misc-scripts/make-sourceball | |
parent | 388d629327d97e8d15a7a67cc87ae36edfe2f385 (diff) |
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 'misc-scripts/make-sourceball')
-rwxr-xr-x | misc-scripts/make-sourceball | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball index e216356..6e57385 100755 --- a/misc-scripts/make-sourceball +++ b/misc-scripts/make-sourceball @@ -22,21 +22,7 @@ _arch="$3" srcpath="$FTP_BASE/sources/" logpath="/var/log/sourceballs/" -cleanup() { - restore_umask - rm -rf "$WORKDIR" - [ "$1" ] && exit $1 -} - -ctrl_c() { - echo "Interrupted" >&2 - cleanup 0 -} - -die() { - echo -e "$*" >&2 - cleanup 1 -} +script_lock create_srcpackage() { if [ -d "$1" ]; then @@ -71,9 +57,6 @@ create_srcpackage() { fi } -trap ctrl_c 2 -trap cleanup 0 1 - set_umask /bin/mkdir -p "$logpath" cd "$WORKDIR" @@ -91,3 +74,5 @@ else die "\tPackage '$packagename' does not exist in repo '$reponame-$_arch'" fi fi + +script_unlock |