blob: 6650ac2be6aca0ae2b35e0b06604446abf8a9987 [file] [log] [blame]
#!/bin/sh
# Cron script for "release". See "build/nightlymc/crontab.txt"
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-1.1.4/bin/svn
type="$1"
versfile="$2"
if [ -z "$type" ]; then
echo "Type not specified" >&2
exit 1
fi
if [ ! -f $versfile ]; then
echo "Version file not specified" >&2
exit 1
fi
subdir=${type}_mass_check
echo "Type: $type"
echo "Version File: $versfile"
echo "Subdir: $subdir"
REV=`tail -1 $versfile | awk '{print $2}'`
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
# normally we'd use --ignore-externals, if we had a newer svn build
rm -rf $RSYNC_DIR/$subdir/rulesrc
# and the "svn external" for rulesrc, separately due to svn export bug:
echo Command: $SVN export --non-interactive \
-r $REV $REPO2_URL $RSYNC_DIR/$subdir/rulesrc
$SVN export --non-interactive \
-r $REV $REPO2_URL $RSYNC_DIR/$subdir/rulesrc
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/cvshead \
> $RSYNC_DIR/$subdir/masses/svninfo.tmp \
< /dev/null