From e5539fc65872aa98d510a03d1e20c207ca6ed058 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 21 Nov 2010 10:07:59 +0100 Subject: sourceballs: fix error handling --- misc-scripts/sourceballs-cleanup | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'misc-scripts/sourceballs-cleanup') diff --git a/misc-scripts/sourceballs-cleanup b/misc-scripts/sourceballs-cleanup index 788cc98..fc5f649 100755 --- a/misc-scripts/sourceballs-cleanup +++ b/misc-scripts/sourceballs-cleanup @@ -52,13 +52,17 @@ cd "$WORKDIR" echo "Orphaned sourceballs:" > "$logfile" for sourceball in "${FTP_BASE}/${SRCPOOL}"/*$SRCEXT; do + [ -f "$sourceball" ] || continue packagename=$(basename $sourceball) packagename=${packagename%-*-*$SRCEXT} - if ! /usr/bin/svn export -q --force "$SVNREPO/$packagename" "$packagename" >/dev/null 2>&1 \ - && ! /usr/bin/svn export -q --force "$SVNREPOCOMMUNITY/$packagename" "$packagename" >/dev/null 2>&1 ; then - echo "$packagename : no longer in svn. Removing sourceball." >> "$logfile" - mv $sourceball $SOURCE_CLEANUP_DESTDIR + if ! /usr/bin/svn export -q --force "$SVNREPO/$packagename" "$packagename" >/dev/null 2>&1; then + if [ $? -ne 1 ]; then + echo "$packagename : svn died during export. Skipping sourceball." >> "$logfile" + else + echo "$packagename : no longer in svn. Removing sourceball." >> "$logfile" + 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 -- cgit v1.2.3-24-g4f1b