Rev 7917 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/bin/shif [ -z "$1" -o -z "$2" ]; thenecho ""echo " Usage: updateSVN <src-root> <target-resources-dir>"echo ""exit 1fiOWD=`pwd`cd "$1"if [ -e .svn ]; thenSVN=svnfor paths in /usr/local/bin /opt/R/arm64/bin; doif [ -e "$paths/svn" ]; thenSVN="$paths/svn"fidoneSVNREV=`$SVN info | sed -n 's/Revision:[ \t]*//p'`if [ -z "$SVNREV" -a -f .svn/entries ]; thenSVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`if [ -z "$SVNREV" ]; then# SVN 1.4 changed the format - this is a pure guess!! (line 4 = revision)SVNREV=`sed -n -e '4 p' .svn/entries`fifielif [ -e REVISION ]; thenSVNREV=`cat REVISION`elif [ -e .git ]; thenSVNREV=`git rev-parse --short HEAD`fiecho "Revision: $SVNREV"if [ -z "$SVNREV" ]; thenecho "Cannot determine SVN revision."exit 2fiif [ ! -e "$1/Info.plist" ]; thenecho "Cannot find Info.plist"exit 3;fi# we no longer use InfoPlist.strings#sed "s/%SVN%/$SVNREV/g" "$1/English.lproj/InfoPlist.strings" > "$2/English.lproj/InfoPlist.strings"# Info.plist is actually one level below resources#sed "s/%SVN%/$SVNREV/g" "$1/Info.plist" > "$2/../Info.plist"# we have to use the target Info.plist because it has been pre-processed by Xcodesed "s/%SVN%/$SVNREV/g" "$2/../Info.plist" > "$2/../Info.plist.final"if [ -e "$2/../Info.plist.final" ]; thenrm -f "$2/../Info.plist"mv "$2/../Info.plist.final" "$2/../Info.plist";fiexit 0