source: roaraudio/tools/send-roaraudio @ 5795:7fcd70dd29f9

Last change on this file since 5795:7fcd70dd29f9 was 5795:7fcd70dd29f9, checked in by phi, 11 years ago

corrected call to cd

  • Property exe set to *
File size: 1.9 KB
RevLine 
[1414]1#!/bin/sh
2
3REMOTEHOST=''
4REMOTEDIR='.'
5
[1416]6CONFIGURE=true
7BUILD=true
8TEST=true
[1535]9PORT=''
[3946]10REV='HEAD'
[5555]11PACKAGE='roaraudio'
[1416]12
[1536]13SSH_OPTS=''
14
[1414]15while [ "$1" != '' ]
16do
17 case "$1" in
[3338]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
[3946]28    --rev=REVISION                - Set the revision (or tag) to send
[5555]29    --package=PACKAGE             - Set package to export (default: roaraudio)
[3338]30HELP
31   exit 0;
32  ;;
[1416]33  '--remote-dir='*)
[2031]34   REMOTEDIR=`echo "$1" | cut -d= -f2`
[1416]35  ;;
[1447]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  ;;
[1535]45  '--port='*)
46   PORT=`echo $1 | cut -d= -f2`
47  ;;
[3946]48  '--rev='*)
49   REV=`echo $1 | cut -d= -f2`
50  ;;
[5555]51  '--package='*)
52   PACKAGE=`echo $1 | cut -d= -f2`
53  ;;
[1414]54  *)
55    REMOTEHOST="$1"
56  ;;
57 esac
58 shift
59done
60
[1535]61if [ "$PORT" != '' ]
62then
[1536]63 SSH_OPTS="-p $PORT $SSH_OPTS"
[1535]64fi
65
[1536]66SSH_OPTS="$SSH_OPTS $REMOTEHOST"
67
[1448]68$CONFIGURE || BUILD=false
69$BUILD     || TEST=false
70
[1414]71LOCALDIR="sra-@$REMOTEHOST"
72
73mkdir $LOCALDIR
74
[1416]75cd $LOCALDIR
[5555]76cvs co -r $REV $PACKAGE
[1416]77cd ..
78
[1414]79{
[1535]80 echo '#!/bin/sh'
[1416]81 echo
82
83 echo 'MAKE=`which gmake make 2> /dev/null | grep ^/ | head -n 1`'
84
[5795]85 echo "cd $PACKAGE"
[1416]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'
[1414]93} > $LOCALDIR/setup
94chmod +rx $LOCALDIR/setup
95
[5555]96tar -czf - $LOCALDIR | ssh $SSH_OPTS "cd $REMOTEDIR && rm -rf $LOCALDIR/$PACKAGE && gunzip | tar -xvf - && cd $LOCALDIR && ./setup"
[1416]97
98rm -rf $LOCALDIR
[1414]99
100#ll
Note: See TracBrowser for help on using the repository browser.