diff options
Diffstat (limited to 'tools/sfsnapshot')
-rwxr-xr-x | tools/sfsnapshot | 28 |
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 | ||
13 | function die { echo $1; exit 1; } | 13 | function 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 |
16 | function make_dist { | 16 | function 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 | |||
60 | IN=${HOME}/tmp_snapshot | 61 | IN=${HOME}/tmp_snapshot |
61 | 62 | ||
62 | # Where to place the generated files | 63 | # Where to place the generated files |
63 | OUT_SERVER="shell.sf.net" | 64 | OUT_SERVER="tonvoon@shell.sf.net" |
64 | OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" | 65 | OUT="/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! |
67 | CF="x86-linux2" | 68 | CF="localhost" |
68 | DS=`date -u +%Y%m%d%H%M` | 69 | DS=`date -u +%Y%m%d%H%M` |
69 | 70 | ||
70 | # Setup home directory area | 71 | # Setup home directory area |
@@ -80,7 +81,7 @@ done | |||
80 | set -x | 81 | set -x |
81 | files=$(ls $IN/*.gz 2>/dev/null) | 82 | files=$(ls $IN/*.gz 2>/dev/null) |
82 | [[ -z $files ]] && die "No files created" | 83 | [[ -z $files ]] && die "No files created" |
83 | head_file=$(cd $IN && ls *HEAD*.gz 2>/dev/null) | 84 | head_file=$(cd $IN && ls *-trunk-*.gz 2>/dev/null) |
84 | ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" | 85 | ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" |
85 | scp -2 $files $OUT_SERVER:$OUT | 86 | scp -2 $files $OUT_SERVER:$OUT |
86 | if [[ -n $head_file ]] ; then | 87 | if [[ -n $head_file ]] ; then |
@@ -91,10 +92,11 @@ fi | |||
91 | ssh -2 $OUT_SERVER << EOF | 92 | ssh -2 $OUT_SERVER << EOF |
92 | cd $OUT | 93 | cd $OUT |
93 | cat <<-END_README > README | 94 | cat <<-END_README > README |
94 | This is the daily CVS snapshot of nagiosplug, consisting of the CVS HEAD | 95 | This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk |
95 | and any other branches. | 96 | and any other branches. |
96 | 97 | ||
97 | The nagios-plugins-HEAD.tar.gz link will always go to the latest HEAD snapshot. | 98 | The 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 | ||
99 | The MD5SUM is: | 101 | The MD5SUM is: |
100 | END_README | 102 | END_README |