[15956] | 1 | function show_help {
|
---|
[16175] | 2 | echo "lirk2 - the LInux Release Kit for greenstone3"
|
---|
[15956] | 3 | echo "Helps you to create releases of Greenstone2 from the Repository"
|
---|
| 4 | echo
|
---|
| 5 | echo "usage: lirk2 [-sim] [-from <target>] [other-args]"
|
---|
| 6 | echo " -sim"
|
---|
| 7 | echo " (shortcut for -Dexecute=false)"
|
---|
| 8 | echo " simulation only, don't actually do anything"
|
---|
| 9 | echo
|
---|
| 10 | echo " -from <target>"
|
---|
| 11 | echo " (shortcut for -Dresume.from=<target>)"
|
---|
| 12 | echo " start execution from the target with the given target address"
|
---|
| 13 | echo " first level targets can be referred to by name. E.g., -from compile is the same as -from 1"
|
---|
| 14 | echo
|
---|
| 15 | echo " -descend"
|
---|
| 16 | echo " (shortcut for -Dresume.mode=descend)"
|
---|
| 17 | echo " execute only the descendents of the target specified with -from"
|
---|
| 18 | echo " for example, with -from 3 -descend, targets 3.1, 3.2, 3.3 etc. would be executed, but execution
|
---|
| 19 | echo " would stop before target 4
|
---|
| 20 | echo
|
---|
| 21 | echo " -cp"
|
---|
| 22 | echo " show the classpath being used by LiRK2"
|
---|
| 23 |
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | #work out the classpath
|
---|
| 27 | CLASSPATH=$JAVA_HOME/lib/tools.jar
|
---|
| 28 | for file in $LIRK2_HOME/lib/*.jar; do
|
---|
| 29 | CLASSPATH=$CLASSPATH:$file
|
---|
| 30 | done
|
---|
[16175] | 31 | for file in $LIRK2_HOME/packages/ant/lib/*.jar; do
|
---|
[15956] | 32 | CLASSPATH=$CLASSPATH:$file
|
---|
| 33 | done
|
---|
[16175] | 34 | for file in $LIRK2_HOME/packages/ant-installer/lib/*.jar; do
|
---|
[15956] | 35 | CLASSPATH=$CLASSPATH:$file
|
---|
| 36 | done
|
---|
[16175] | 37 | CLASSPATH=$CLASSPATH:$LIRK2_HOME/packages/ant-installer/classes
|
---|
[15956] | 38 |
|
---|
| 39 | #create the command
|
---|
[16188] | 40 | toexec="$LIRK2_HOME/packages/ant/bin/ant -lib `pwd`/installer/classes -f $LIRK2_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -Dlirk2.home=$LIRK2_HOME"
|
---|
[15956] | 41 |
|
---|
| 42 | #pass on the arguments
|
---|
| 43 | while [ "$1" != "" ]; do
|
---|
| 44 |
|
---|
| 45 | if [ "$1" == "-help" ]; then
|
---|
| 46 | show_help
|
---|
| 47 | exit
|
---|
| 48 |
|
---|
| 49 | elif [ "$1" == "-cp" ]; then
|
---|
| 50 | echo $CLASSPATH
|
---|
| 51 | exit
|
---|
| 52 |
|
---|
| 53 | elif [ "$1" == "-sim" ]; then
|
---|
| 54 | toexec="$toexec -Dexecute=false"
|
---|
| 55 | shift
|
---|
| 56 |
|
---|
| 57 | elif [ "$1" == "-descend" ]; then
|
---|
| 58 | toexec="$toexec -Dresume.mode=descend"
|
---|
| 59 | shift
|
---|
| 60 |
|
---|
| 61 | elif [ "$1" == "-from" ]; then
|
---|
| 62 |
|
---|
| 63 | toexec="$toexec -Dresume.from="
|
---|
| 64 | from=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
|
---|
| 65 | toexec=$toexec$from
|
---|
| 66 | shift 2
|
---|
| 67 |
|
---|
| 68 | elif [ "$1" == "-to" ]; then
|
---|
| 69 |
|
---|
| 70 | toexec="$toexec -Dresume.to="
|
---|
| 71 | to=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
|
---|
| 72 | toexec=$toexec$to
|
---|
| 73 | shift 2
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | else
|
---|
| 77 | toexec="$toexec $1"
|
---|
| 78 | shift
|
---|
| 79 | fi
|
---|
| 80 |
|
---|
| 81 | done
|
---|
| 82 |
|
---|
| 83 | #echo $toexec
|
---|
| 84 | echo "O---------------------------------------O"
|
---|
| 85 | echo "| |"
|
---|
| 86 | echo "| LiRK2 |"
|
---|
| 87 | echo "| Linux Release Kit for Greenstone2 |"
|
---|
| 88 | echo "| |"
|
---|
| 89 | echo "O---------------------------------------O"
|
---|
| 90 | echo "Basedir : `pwd`"
|
---|
| 91 |
|
---|
| 92 | $toexec
|
---|