2001-04-15 00:26:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-06-20 12:08:19 +02:00
|
|
|
test "$1" && extra="-$1"
|
2006-06-06 14:01:34 +02:00
|
|
|
|
2006-07-30 01:30:55 +02:00
|
|
|
svn_revision=`LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
|
2007-09-06 18:25:44 +02:00
|
|
|
test $svn_revision || svn_revision=`grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
|
2007-09-06 18:28:31 +02:00
|
|
|
test $svn_revision || svn_revision=`sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null`
|
2006-06-23 17:12:56 +02:00
|
|
|
test $svn_revision || svn_revision=UNKNOWN
|
|
|
|
|
2006-06-22 15:47:50 +02:00
|
|
|
NEW_REVISION="#define VERSION \"dev-SVN-r${svn_revision}${extra}\""
|
|
|
|
OLD_REVISION=`cat version.h 2> /dev/null`
|
2008-01-02 08:38:40 +01:00
|
|
|
TITLE="#define MP_TITLE \"MPlayer dev-SVN-r${svn_revision}${extra} (C) 2000-2008 MPlayer Team\""
|
2006-06-22 15:47:50 +02:00
|
|
|
|
|
|
|
# Update version.h only on revision changes to avoid spurious rebuilds
|
|
|
|
if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
|
|
|
echo "$NEW_REVISION" > version.h
|
2006-12-28 16:31:48 +01:00
|
|
|
echo "$TITLE" >> version.h
|
2006-06-22 15:47:50 +02:00
|
|
|
fi
|