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 2007/09/26 12:50:50 UTC
svn commit: r579581 - in /spamassassin/trunk/masses/rule-qa: corpus-nightly
corpus-nightly.post-svn
Author: jm
Date: Wed Sep 26 03:50:49 2007
New Revision: 579581
URL: http://svn.apache.org/viewvc?rev=579581&view=rev
Log:
split corpus-nightly into two scripts, so that changes made to the script itself during SVN update will take effect
Added:
spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn (with props)
Modified:
spamassassin/trunk/masses/rule-qa/corpus-nightly
Modified: spamassassin/trunk/masses/rule-qa/corpus-nightly
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/corpus-nightly?rev=579581&r1=579580&r2=579581&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-nightly (original)
+++ spamassassin/trunk/masses/rule-qa/corpus-nightly Wed Sep 26 03:50:49 2007
@@ -31,11 +31,8 @@
)
# day of week
-if date | egrep '^Sat' || [ "$1" = "net" ]; then
- net="net-"
-else
- net=""
-fi
+net=""
+if date | egrep '^Sat' || [ "$1" = "net" ]; then net="net-" ; fi
# enter tree
if [ -d $tree ] ; then
@@ -45,8 +42,6 @@
exit 2
fi
-[ -d $tmp ] || mkdir -p $tmp
-
# find current revision
rm -f weekly-versions.txt nightly-versions.txt
if ! wget --tries=120 --wait=30 \
@@ -101,85 +96,6 @@
done
set -e
-# build
-$PERL Makefile.PL < /dev/null
-make
-
-# call ext command, if required
-if [ "x${pre_mass_check_command:-}" != x ] ; then
- $pre_mass_check_command
-fi
-
-# run test
-cd masses
-rm -f spamassassin/auto*
-rm -f spamassassin/bayes*
-rm -f razor-agent.log
-[ -d spamassassin ] || mkdir spamassassin
-
-if [ -n "$net" ]; then
- prefs=$prefs_weekly
- opts=$opts_weekly
-else
- prefs=$prefs_nightly
- opts=$opts_nightly
-fi
-if [ -n "$prefs" -a -f "$prefs" ]; then
- cp $prefs spamassassin/user_prefs
-else
- rm -f spamassassin/user_prefs
-fi
-
-date | tee test.start
-
-if [ "${clienthosts:-}" = "" ] ; then
-
- # local mass-check
- $PERL mass-check $opts
-
-else
-
- # client-server mode
+# once we have everything checked out, run "part 2"
+exec $tree/masses/rule-qa/corpus-nightly.post-svn
- # copy the certs from their storage dir; this is not checked
- # in, since that would allow third-party hosts to connect to
- # the master server and "steal" scanned mails
- cp /local/bbmasstools/mass-check-certs/*.pem spamassassin/
-
- $PERL mass-check --noisy --progress --cs_ssl --server $serverhost \
- --run_post_scan="./rule-qa/nightly-slaves-start $clienthosts" \
- $opts
-
- # the slaves will be started if the "run" stage is started, and
- # will exit when the server mass-check does (they "phone home"
- # to the specified server host/port and exit if that disappears
- # for a long time)
-fi
-
-date | tee test.end
-
-uptime
-ls -l spam.log ham.log
-
-# results name
-mv spam.log spam-$net$username.log
-mv ham.log ham-$net$username.log
-
-# rsync
-set +e
-retry=0
-while true; do
- if rsync -Pcvuzb --timeout=120 \
- spam-$net$username.log ham-$net$username.log \
- $username@rsync.spamassassin.org::corpus/
- then
- break;
- fi
- if [ $retry -eq 120 ]; then
- echo "rsync failed" 1>&2
- exit 1
- fi
- retry=$(( $retry + 1 ))
- sleep 30
-done
-set -e
Added: spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn?rev=579581&view=auto
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn (added)
+++ spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn Wed Sep 26 03:50:49 2007
@@ -0,0 +1,110 @@
+#!/bin/sh
+#
+# second (post-SVN-update) part of corpus-nightly. This is a separate
+# script so that, if SVN updates it, changes will take effect in this
+# mass-check
+
+. $HOME/.corpus
+
+RSYNC_PASSWORD=$password ; export RSYNC_PASSWORD
+
+# use $PERL from env if unset
+if [ "x${PERL:-}" = x ] ; then PERL=perl ; fi
+export PERL
+
+set -x
+set -e
+
+# day of week
+net=""
+if date | egrep '^Sat' || [ "$1" = "net" ]; then net="net-" ; fi
+
+# enter tree
+cd $tree || exit 5
+
+[ -d $tmp ] || mkdir -p $tmp
+
+# build
+$PERL Makefile.PL < /dev/null
+make
+
+# call ext command, if required
+if [ "x${pre_mass_check_command:-}" != x ] ; then
+ $pre_mass_check_command
+fi
+
+# run test
+cd masses
+rm -f spamassassin/auto*
+rm -f spamassassin/bayes*
+rm -f razor-agent.log
+[ -d spamassassin ] || mkdir spamassassin
+
+if [ -n "$net" ]; then
+ prefs=$prefs_weekly
+ opts=$opts_weekly
+else
+ prefs=$prefs_nightly
+ opts=$opts_nightly
+fi
+if [ -n "$prefs" -a -f "$prefs" ]; then
+ cp $prefs spamassassin/user_prefs
+else
+ rm -f spamassassin/user_prefs
+fi
+
+date | tee test.start
+
+if [ "${clienthosts:-}" = "" ] ; then
+
+ # local mass-check
+ $PERL mass-check $opts
+
+else
+
+ # client-server mode
+
+ # copy the certs from their storage dir; this is not checked
+ # in, since that would allow third-party hosts to connect to
+ # the master server and "steal" scanned mails
+ cp /local/bbmasstools/mass-check-certs/*.pem spamassassin/
+
+ $PERL mass-check --noisy --progress --cs_ssl --server $serverhost \
+ --run_post_scan="./rule-qa/nightly-slaves-start $clienthosts" \
+ $opts
+
+ # the slaves will be started if the "run" stage is started, and
+ # will exit when the server mass-check does (they "phone home"
+ # to the specified server host/port and exit if that disappears
+ # for a long time)
+fi
+
+date | tee test.end
+
+uptime
+ls -l spam.log ham.log
+
+# results name
+mv spam.log spam-$net$username.log
+mv ham.log ham-$net$username.log
+
+# rsync
+set +e
+retry=0
+while true; do
+ if rsync -Pcvuzb --timeout=120 \
+ spam-$net$username.log ham-$net$username.log \
+ $username@rsync.spamassassin.org::corpus/
+ then
+ break;
+ fi
+ if [ $retry -eq 120 ]; then
+ echo "rsync failed" 1>&2
+ exit 1
+ fi
+ retry=$(( $retry + 1 ))
+ sleep 30
+done
+set -e
+
+exit 0
Propchange: spamassassin/trunk/masses/rule-qa/corpus-nightly.post-svn
------------------------------------------------------------------------------
svn:executable = *