source: roaraudio/tools/send-roaraudio @ 3946:81ec5a330417

Last change on this file since 3946:81ec5a330417 was 3946:81ec5a330417, checked in by phi, 9 years ago

added support for --rev

  • Property exe set to *
File size: 1.7 KB
Line 
1#!/bin/sh
2
3REMOTEHOST=''
4REMOTEDIR='.'
5
6CONFIGURE=true
7BUILD=true
8TEST=true
9PORT=''
10REV='HEAD'
11
12SSH_OPTS=''
13
14while [ "$1" != '' ]
15do
16 case "$1" in
17  '-h'|'--help')
18  echo "Usage: $0 [OPTIONS] host..."
19  echo
20cat <<HELP
21 -h --help                        - Show this help
22    --remote-dir=DIR              - Set dir on remote site
23    --build={true|false}          - build on remote site?
24    --configure={true,false}      - configure on remote site?
25    --test={true,false}           - test on remote site?
26    --port=PORT                   - Set port of remote site
27    --rev=REVISION                - Set the revision (or tag) to send
28HELP
29   exit 0;
30  ;;
31  '--remote-dir='*)
32   REMOTEDIR=`echo "$1" | cut -d= -f2`
33  ;;
34  '--build='*)
35   BUILD=`echo $1 | cut -d= -f2`
36  ;;
37  '--configure='*)
38   CONFIGURE=`echo $1 | cut -d= -f2`
39  ;;
40  '--test='*)
41   TEST=`echo $1 | cut -d= -f2`
42  ;;
43  '--port='*)
44   PORT=`echo $1 | cut -d= -f2`
45  ;;
46  '--rev='*)
47   REV=`echo $1 | cut -d= -f2`
48  ;;
49  *)
50    REMOTEHOST="$1"
51  ;;
52 esac
53 shift
54done
55
56if [ "$PORT" != '' ]
57then
58 SSH_OPTS="-p $PORT $SSH_OPTS"
59fi
60
61SSH_OPTS="$SSH_OPTS $REMOTEHOST"
62
63$CONFIGURE || BUILD=false
64$BUILD     || TEST=false
65
66LOCALDIR="sra-@$REMOTEHOST"
67
68mkdir $LOCALDIR
69
70cd $LOCALDIR
71cvs co -r $REV roaraudio
72cd ..
73
74{
75 echo '#!/bin/sh'
76 echo
77
78 echo 'MAKE=`which gmake make 2> /dev/null | grep ^/ | head -n 1`'
79
80 echo 'cd roaraudio'
81
82 $CONFIGURE && echo './configure || exit 1'
83 $BUILD     && echo '$MAKE       || exit 2'
84 $TEST      && echo '$MAKE test  || exit 3'
85
86 echo 'exit 0'
87 echo '#ll'
88} > $LOCALDIR/setup
89chmod +rx $LOCALDIR/setup
90
91tar -czf - $LOCALDIR | ssh $SSH_OPTS "cd $REMOTEDIR && rm -rf $LOCALDIR && gunzip | tar -xvf - && cd $LOCALDIR && ./setup"
92
93rm -rf $LOCALDIR
94
95#ll
Note: See TracBrowser for help on using the repository browser.