source: roaraudio/tools/send-roaraudio @ 5555:e2230ec286e8

Last change on this file since 5555:e2230ec286e8 was 5555:e2230ec286e8, checked in by phi, 7 years ago

Update to allow sending other packages as well.
This is useful to test packages closely related to this like rpld.

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