The R Project SVN R-packages

Rev

Rev 2295 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#!/bin/sh

if [ -z "$1" -o -z "$2" ]; then
    echo ""
    echo " Usage: updateSVN <src-root> <target-resources-dir>"
    echo ""
    exit 1
fi

OWD=`pwd`
cd "$1"
SVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`
echo "Revision: $SVNREV"

if [ -z "$SVNREV" ]; then
    echo "Cannot determine SVN revision."
    exit 2
fi

if [ ! -e "$1/English.lproj/InfoPlist.strings" ]; then
    echo "Cannot find $1/English.lproj/InfoPlist.strings"
    exit 2;
fi
if [ ! -e "$1/Info.plist" ]; then
    echo "Cannot find Info.plist"
    exit 3;
fi

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"

exit 0