From 948583aebe9e8e5a3daa9131c99dc68724e06b49 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 21 Nov 2010 12:40:29 +0100 Subject: sourceballs: respect the dryrun setting --- misc-scripts/sourceballs-cleanup | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc-scripts/sourceballs-cleanup b/misc-scripts/sourceballs-cleanup index f75c688..450d137 100755 --- a/misc-scripts/sourceballs-cleanup +++ b/misc-scripts/sourceballs-cleanup @@ -8,6 +8,8 @@ logfile="${LOGDIR}/sourceballs/cleanup.txt" script_lock +${CLEANUP_DRYRUN} && warning 'dry run mode is active' + remove_old() { if [ -d "$1" ]; then pushd "$1" >/dev/null @@ -36,7 +38,7 @@ remove_old() { fi done if [ $skip -ne 1 ]; then - mv "$srcpkg" $SOURCE_CLEANUP_DESTDIR + ${CLEANUP_DRYRUN} || mv "$srcpkg" $SOURCE_CLEANUP_DESTDIR fi fi done @@ -65,14 +67,14 @@ for sourceball in "${FTP_BASE}/${SRCPOOL}"/*$SRCEXT; do echo "$packagename : svn died during export. Skipping sourceball." >> "$logfile" else echo "$packagename : no longer in svn. Removing sourceball." >> "$logfile" - mv $sourceball $SOURCE_CLEANUP_DESTDIR + ${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR fi elif [ -z "$(ls -A "$packagename/repos")" ]; then echo "$packagename : no longer in repos but trunk is still in svn. Removing sourceball." >> "$logfile" - mv $sourceball $SOURCE_CLEANUP_DESTDIR + ${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR elif ! source "$packagename/trunk/PKGBUILD" && chk_license ${license[@]}; then echo "$packagename : source hosting no longer required by license. Removing sourceball." >> "$logfile" - mv $sourceball $SOURCE_CLEANUP_DESTDIR + ${CLEANUP_DRYRUN} || mv $sourceball $SOURCE_CLEANUP_DESTDIR else remove_old "$packagename/repos/" fi -- cgit v1.2.3-24-g4f1b