From fdca04b3f5d8e27af4829416fee3843b0fe01e36 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Aug 2010 16:43:16 +0200 Subject: Use db-functions in create-filelists and sourceballs --- cron-jobs/sourceballs | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'cron-jobs/sourceballs') 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 -- cgit v1.2.3-2-g168b