diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 16:43:16 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-08 16:43:16 +0200 |
commit | fdca04b3f5d8e27af4829416fee3843b0fe01e36 (patch) | |
tree | 8c8ad6921040cb24f9ede59c1a94a25a4e268876 /cron-jobs/sourceballs | |
parent | 830c4d84d13712974ffd392cdcc58b038c0dcfd9 (diff) |
Use db-functions in create-filelists and sourceballs
Diffstat (limited to 'cron-jobs/sourceballs')
-rwxr-xr-x | cron-jobs/sourceballs | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 93cb842..78c3959 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,37 +1,16 @@ #!/bin/bash -ftpbase="/srv/ftp" -srcbase="/srv/ftp/sources" -repos="core extra testing community community-testing" - . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" -LOCKFILE="/tmp/.sourceball.lock" - -cleanup () { - rm -f "$LOCKFILE" - restore_umask - exit 0 -} - -ctrl_c() { - cleanup -} +ftpbase="${FTP_BASE}" +srcbase="${FTP_BASE}/sources" +repos=(core extra testing community community-testing) -if [ -f "$LOCKFILE" ]; then - owner="$(/usr/bin/stat -c %U $LOCKFILE)" - echo "error: source tarball generation is already in progress (started by $owner)" - exit 1 -fi - -trap cleanup 0 -trap ctrl_c 2 +script_lock set_umask -/bin/touch "$LOCKFILE" - dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" FAILED_PKGS="" @@ -39,7 +18,7 @@ FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" -for repo in $repos; do +for repo in ${repos[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then @@ -91,4 +70,4 @@ fi $dirname/../misc-scripts/sourceballs-cleanup -cleanup +script_unlock |