Changeset 21386 for main/trunk
- Timestamp:
- 2009-12-22T10:49:52+13:00 (14 years ago)
- Location:
- main/trunk/release-kits
- Files:
-
- 7 added
- 5 deleted
- 1 edited
- 1 copied
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/bin/rk
r21385 r21386 1 1 #!/bin/bash 2 2 3 #determine requested release kit4 echo $05 exit6 7 8 9 3 function show_title() { 4 echo "RK_HOME: $RK_HOME" 10 5 echo "O---------------------------------------------O" 11 6 echo … … 17 12 } 18 13 19 #pre checks20 if [ "$rk_name" == "" ]; then21 echo "rk_name not set";22 exit;23 elif [ "$RK_HOME" == "" ]; then24 echo "RK_HOME not set";25 exit26 fi27 28 14 function show_help { 29 30 15 echo "$rk_name - $rk_fullname" 31 echo " Helps you to create releases from the Repository"16 echo "Automatically creates Greenstone releases" 32 17 echo 33 echo "usage: $rk_name [-sim] [-from <target>] [other-args]" 34 echo " -sim" 35 echo " simulation only, don't actually do anything" 36 echo 18 echo "usage: $rk_name [-help|-cmd] [ANT_ARGS]" 37 19 echo " -help" 38 20 echo " show this help screen" 39 echo40 echo " -from <target>"41 echo " start execution from the target with the given target address"42 echo43 echo " -to <target>"44 echo " stop execution just before the target with the given target address"45 echo46 echo " -descend <target>"47 echo " execute only the target with the given address, including subtargets"48 echo49 21 echo 50 22 echo " -cmd" 51 23 echo " show the ant command being used by $rk_name" 52 24 echo 53 echo " -properties" 54 echo " show the properties required/allowed in $rk_name-build.properties" 55 25 echo " ANT_ARGS" 26 echo " Additional arguments to be passed to ant" 56 27 } 57 28 58 #cd up a level or two if needed 59 if [ ! -e "$rk_name-build.properties" ]; then 60 if [ -e "../$rk_name-build.properties" ]; then 61 RKOLDPWD=`pwd` 62 cd .. 63 elif [ -e "../../$rk_name-build.properties" ]; then 64 RKOLDPWD=`pwd` 65 cd ../.. 66 fi 29 #determine requested release kit 30 rk_name="$(basename $0)" 31 export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)" 32 33 if [ "$rk_name" == "rk2" ]; then 34 rk_fullname="Release Kit for Greenstone2" 35 elif [ "$rk_name" == "rk3" ]; then 36 rk_fullname="Release Kit for Greenstone3" 37 else 38 echo "Unrecognised release-kit name '$rk_name'" >&2 39 exit 67 40 fi 68 41 69 #set ANT_HOME 70 export ANT_HOME=$RK_HOME/core/ant 42 43 #cd up a level or two if needed 44 if [ -e "$rk_name-build.properties" ]; then 45 pushd . 46 elif [ -e "../$rk_name-build.properties" ]; then 47 pushd .. 48 elif [ -e "../../$rk_name-build.properties" ]; then 49 pushd ../.. 50 else 51 echo "couldn't find file $rk_name-build.properties" 52 echo "it should exist in the top level of the release" 53 exit 54 fi 55 56 #make sure ant has enough memory 71 57 export ANT_OPTS=-Xmx800M 72 58 73 59 #create the command 74 toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/ ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"60 toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/$rk_name/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME" 75 61 76 62 #pass on the arguments … … 89 75 done 90 76 91 if [ "$target" != "" ]; then 92 toexec="$toexec $target" 93 fi 94 95 #execute (or show the command to be executed) 77 #show the command to be executed 96 78 if [ "$show_cmd" == "true" ]; then 97 79 echo $toexec 80 #execute 98 81 else 99 82 show_title | tee ${rk_name}.out … … 101 84 fi 102 85 103 if [ "$RKOLDPWD" != "" ]; then 104 cd $RKOLDPWD 105 fi 106 86 #go back to original dir 87 popd
Note:
See TracChangeset
for help on using the changeset viewer.