2007-02-20 23:01:25 +00:00
|
|
|
#!/bin/sh
|
2007-01-22 23:09:07 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2007-02-20 23:01:25 +00:00
|
|
|
# $Id$
|
2007-01-22 23:09:07 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Usage: svnversion.sh [source-root]
|
|
|
|
|
|
|
|
VERSIONFILE=docs/VERSION
|
|
|
|
if [ -n "$1" ]; then TOP=$1; else TOP=..; fi
|
|
|
|
if [ -r $TOP/$VERSIONFILE ]; then SVNVER=`cat $TOP/$VERSIONFILE`;
|
2007-02-20 23:01:25 +00:00
|
|
|
else if [ `which svnversion 2>/dev/null` ]; then
|
|
|
|
SVNALT=`svnversion $1`;
|
|
|
|
if [ "$SVNALT" = "exported" ]; then
|
2007-01-25 11:39:30 +00:00
|
|
|
# try getting it from a subdir to test if perhaps they are symlinked
|
|
|
|
# from the root
|
|
|
|
SVNALT=`svnversion $1/tools`
|
2007-02-20 23:01:25 +00:00
|
|
|
if [ "$SVNALT" != exported ]; then
|
2007-01-25 11:39:30 +00:00
|
|
|
# yeah, it is there so we use this
|
|
|
|
SVNVER="r$SVNALT"
|
|
|
|
else
|
2007-02-20 23:01:25 +00:00
|
|
|
SVNALT="unknown";
|
2007-01-25 11:39:30 +00:00
|
|
|
fi
|
2007-02-20 23:01:25 +00:00
|
|
|
else
|
|
|
|
SVNVER="r$SVNALT";
|
2007-01-22 23:09:07 +00:00
|
|
|
fi
|
|
|
|
else SVNVER="unknown"; fi
|
|
|
|
fi
|
|
|
|
VERSION=$SVNVER-`date -u +%y%m%d`
|
|
|
|
echo $VERSION
|
|
|
|
|