summaryrefslogtreecommitdiffstats
path: root/tools/sfsnapshot
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sfsnapshot')
-rwxr-xr-xtools/sfsnapshot28
1 files changed, 15 insertions, 13 deletions
diff --git a/tools/sfsnapshot b/tools/sfsnapshot
index 46f34a3..efc5f01 100755
--- a/tools/sfsnapshot
+++ b/tools/sfsnapshot
@@ -12,26 +12,27 @@
12 12
13function die { echo $1; exit 1; } 13function die { echo $1; exit 1; }
14 14
15# This makes the distribution. Expects $1 as CVS tag, otherwise uses HEAD 15# This makes the distribution. Expects $1 as branches/name, otherwise uses trunk
16function make_dist { 16function make_dist {
17 if [[ -n $1 ]] ; then 17 if [[ -n $1 ]] ; then
18 cvs_rel=$1 18 svn_url_suffix=$1
19 v="$1-" 19 name=${1##*/}
20 else 20 else
21 cvs_rel="HEAD" 21 svn_url_suffix="trunk"
22 v="HEAD-" 22 name="trunk"
23 fi 23 fi
24 v="$name-"
24 25
25 # Get compile server to do the work 26 # Get compile server to do the work
26 # Variables will be expanded locally before being run on $CF 27 # Variables will be expanded locally before being run on $CF
27 ssh $CF <<EOF 28 ssh $CF <<EOF
28 set -x 29 set -x
29 PATH=$PATH:/usr/local/bin 30 PATH=$PATH:/usr/local/bin
30 [[ ! -d $COMPILE_DIR/$cvs_rel ]] && mkdir -p $COMPILE_DIR/$cvs_rel 31 [[ ! -d $COMPILE_DIR/$name ]] && mkdir -p $COMPILE_DIR/$name
31 cd $COMPILE_DIR/$cvs_rel 32 cd $COMPILE_DIR/$name
32 33
33 # Cannot use cvs export due to conflicts on second run - think this is better for cvs server 34 # Cannot use cvs export due to conflicts on second run - think this is better for cvs server
34 CVS_RSH=ssh cvs -z3 -d:ext:tonvoon@nagiosplug.cvs.sourceforge.net:/cvsroot/nagiosplug co -r $cvs_rel nagiosplug 35 svn export https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/$svn_url_suffix $PROJECT
35 36
36 cd $PROJECT 37 cd $PROJECT
37 38
@@ -60,11 +61,11 @@ COMPILE_DIR=/tmp/tonvoon/tmp_snapshot
60IN=${HOME}/tmp_snapshot 61IN=${HOME}/tmp_snapshot
61 62
62# Where to place the generated files 63# Where to place the generated files
63OUT_SERVER="shell.sf.net" 64OUT_SERVER="tonvoon@shell.sf.net"
64OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" 65OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot"
65 66
66# Make sure prereqs are satisfied on server! 67# Make sure prereqs are satisfied on server!
67CF="x86-linux2" 68CF="localhost"
68DS=`date -u +%Y%m%d%H%M` 69DS=`date -u +%Y%m%d%H%M`
69 70
70# Setup home directory area 71# Setup home directory area
@@ -80,7 +81,7 @@ done
80set -x 81set -x
81files=$(ls $IN/*.gz 2>/dev/null) 82files=$(ls $IN/*.gz 2>/dev/null)
82[[ -z $files ]] && die "No files created" 83[[ -z $files ]] && die "No files created"
83head_file=$(cd $IN && ls *HEAD*.gz 2>/dev/null) 84head_file=$(cd $IN && ls *-trunk-*.gz 2>/dev/null)
84ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" 85ssh -2 $OUT_SERVER "rm -f $OUT/*.gz"
85scp -2 $files $OUT_SERVER:$OUT 86scp -2 $files $OUT_SERVER:$OUT
86if [[ -n $head_file ]] ; then 87if [[ -n $head_file ]] ; then
@@ -91,10 +92,11 @@ fi
91ssh -2 $OUT_SERVER << EOF 92ssh -2 $OUT_SERVER << EOF
92cd $OUT 93cd $OUT
93cat <<-END_README > README 94cat <<-END_README > README
94This is the daily CVS snapshot of nagiosplug, consisting of the CVS HEAD 95This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk
95and any other branches. 96and any other branches.
96 97
97The nagios-plugins-HEAD.tar.gz link will always go to the latest HEAD snapshot. 98The nagios-plugins-HEAD.tar.gz link will always go to the latest trunk snapshot
99(name kept for existing tinderbox scripts to link correctly).
98 100
99The MD5SUM is: 101The MD5SUM is:
100END_README 102END_README