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
|
|
|
|
2009-02-25 00:15:26 +01:00
|
|
|
# Extract revision number from file used by daily tarball snapshots
|
|
|
|
# or from the places different Subversion versions have it.
|
|
|
|
svn_revision=$(cat snapshot_version 2> /dev/null)
|
|
|
|
test $svn_revision || svn_revision=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
|
2009-02-24 23:57:55 +01:00
|
|
|
test $svn_revision || svn_revision=$(grep revision .svn/entries 2>/dev/null | cut -d '"' -f2)
|
|
|
|
test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null)
|
2009-03-06 00:36:28 +01:00
|
|
|
test $svn_revision && svn_revision=SVN-r$svn_revision
|
2006-06-23 17:12:56 +02:00
|
|
|
test $svn_revision || svn_revision=UNKNOWN
|
|
|
|
|
2009-03-06 00:36:28 +01:00
|
|
|
# releases extract the version number from the VERSION file
|
|
|
|
version=$(cat VERSION 2> /dev/null)
|
|
|
|
test $version || version=$svn_revision
|
|
|
|
|
|
|
|
NEW_REVISION="#define VERSION \"${version}${extra}\""
|
2009-04-04 21:50:57 +02:00
|
|
|
OLD_REVISION=$(head -n 1 version.h 2> /dev/null)
|
2009-01-29 01:18:32 +01:00
|
|
|
TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2009 MPlayer Team\n"'
|
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
|
2009-01-29 01:16:09 +01:00
|
|
|
cat <<EOF > version.h
|
|
|
|
$NEW_REVISION
|
|
|
|
$TITLE
|
|
|
|
EOF
|
2006-06-22 15:47:50 +02:00
|
|
|
fi
|