demux_mkv: use new EBML parser for Info parsing
[mplayer/kovensky.git] / version.sh
blob1a3f14049e96225f8b7e1a0ee70f7eb1a9cd3e79
1 #!/bin/sh
3 test "$1" && extra="-$1"
5 # Extract revision number from file used by daily tarball snapshots
6 # or from the places different Subversion versions have it.
7 git_revision=$(cat snapshot_version 2> /dev/null)
8 test $git_revision || test -d .git && git_revision=`git describe --always`
9 test $git_revision && git_revision=git-$git_revision
10 test $git_revision || git_revision=UNKNOWN
12 # releases extract the version number from the VERSION file
13 version=$(cat VERSION 2> /dev/null)
14 test $version || version=$git_revision
16 NEW_REVISION="#define VERSION \"${version}${extra}\""
17 OLD_REVISION=$(head -n 1 version.h 2> /dev/null)
18 TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2009 MPlayer Team\n"'
20 # Update version.h only on revision changes to avoid spurious rebuilds
21 if test "$NEW_REVISION" != "$OLD_REVISION"; then
22 cat <<EOF > version.h
23 $NEW_REVISION
24 $TITLE
25 EOF