You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2010/01/10 23:22:38 UTC
svn commit: r897722 - /spamassassin/trunk/backend/nitemc/extract_to_rsync_dir
Author: jm
Date: Sun Jan 10 22:22:38 2010
New Revision: 897722
URL: http://svn.apache.org/viewvc?rev=897722&view=rev
Log:
attempt to add some decent error-checking to this script
Modified:
spamassassin/trunk/backend/nitemc/extract_to_rsync_dir
Modified: spamassassin/trunk/backend/nitemc/extract_to_rsync_dir
URL: http://svn.apache.org/viewvc/spamassassin/trunk/backend/nitemc/extract_to_rsync_dir?rev=897722&r1=897721&r2=897722&view=diff
==============================================================================
--- spamassassin/trunk/backend/nitemc/extract_to_rsync_dir (original)
+++ spamassassin/trunk/backend/nitemc/extract_to_rsync_dir Sun Jan 10 22:22:38 2010
@@ -4,9 +4,7 @@
RSYNC_DIR=/home/corpus-rsync/tagged_builds
REPO_URL=http://svn.apache.org/repos/asf/spamassassin/trunk
-REPO2_URL=http://svn.apache.org/repos/asf/spamassassin/rules/trunk
PERL=/local/perl586/bin/perl
-
SVN=/opt/subversion-current/bin/svn
type="$1"
@@ -23,6 +21,7 @@
fi
subdir=${type}_mass_check
+set -ex
echo "Type: $type"
echo "Version File: $versfile"
@@ -32,20 +31,29 @@
echo "Revision: $REV"
-# export the main repo:
-rm -rf $RSYNC_DIR/$subdir
-echo Command: $SVN export --non-interactive \
- -r $REV $REPO_URL $RSYNC_DIR/$subdir
-$SVN export --non-interactive \
- -r $REV $REPO_URL $RSYNC_DIR/$subdir
-
-cd $RSYNC_DIR/$subdir
-$PERL build/mkrules --out rules > /dev/null
-
-# create "svn info" file for mass-check
-# we assume that the current directory was updated via cron to the correct
-# revision, so just info it. (can't do remote info with the svn version
-# installed on the zones machine, nor will it accept "--non-interactive")
-$SVN info $HOME/versions/trunk \
- > $RSYNC_DIR/$subdir/masses/svninfo.tmp \
- < /dev/null
+for retry in 1 2 3 4 5 6 7 8 9 10 ; do
+
+ # export the main repo:
+ rm -rf $RSYNC_DIR/$subdir
+ echo Command: $SVN export --non-interactive \
+ -r $REV $REPO_URL $RSYNC_DIR/$subdir
+ $SVN export --non-interactive -r $REV $REPO_URL $RSYNC_DIR/$subdir \
+ || continue
+
+ cd $RSYNC_DIR/$subdir
+ $PERL build/mkrules --out rules > /dev/null || continue
+
+ # create "svn info" file for mass-check
+ # we assume that the current directory was updated via cron to the correct
+ # revision, so just info it. (can't do remote info with the svn version
+ # installed on the zones machine, nor will it accept "--non-interactive")
+ $SVN info $HOME/versions/trunk \
+ > $RSYNC_DIR/$subdir/masses/svninfo.tmp \
+ < /dev/null || continue
+
+ exit # assume success at this point
+done
+
+echo "FAILED to extract to rsync dir" 1>&2
+exit 2
+