3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
11 # Usage: svnversion.sh [source-root]
13 # Prints the revision "rXYZ" of the first argument, as reported by svnversion.
14 # Prints "unknown" if svnversion fails or says "exported".
16 # LANG=C forces svnversion to not localize "exported".
17 if OUTPUT
=`LANG=C svnversion "$@"`; then
18 if [ "$OUTPUT" = "exported" ]; then
28 VERSIONFILE
=docs
/VERSION
29 if [ -n "$1" ]; then TOP
=$1; else TOP
=..
; fi
30 if [ -r $TOP/$VERSIONFILE ]; then SVNVER
=`cat $TOP/$VERSIONFILE`;
32 SVNVER
=`svnversion_safe $TOP`;
33 if [ "$SVNVER" = "unknown" ]; then
34 # try getting it from a subdir to test if perhaps they are symlinked
36 SVNVER
=`svnversion_safe $TOP/tools`;
39 VERSION
=$SVNVER-`date -u +%y%m%d`