diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2007-07-24 00:35:16 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2007-07-24 00:35:16 +0000 |
commit | ff50baf6dead1fa1e095ba7b8c3041c29a588172 (patch) | |
tree | 5f03bd4cbd6eed882d6ffde77008eb012f8dd90f /tools/sfsnapshot | |
parent | 475ee7b55a24ed6a17e0bb5ef762560ebb0ab152 (diff) | |
download | monitoring-plugins-ff50baf6dead1fa1e095ba7b8c3041c29a588172.tar.gz |
Updated to use svn instead of cvs
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1760 f882894a-f735-0410-b71e-b25c423dba1c
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 46f34a3d..efc5f013 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 |