Mercurial > mplayer.hg
comparison version.sh @ 32891:744741d2607a
Do not run svn or otherwise try to extract the svn revision when
we have a VERSION file we'll be using anyway.
author | reimar |
---|---|
date | Sun, 27 Feb 2011 15:14:23 +0000 |
parents | 3bb138f3c634 |
children | 6f190a6ae713 |
comparison
equal
deleted
inserted
replaced
32890:96340f2c8c17 | 32891:744741d2607a |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 test "$1" && extra="-$1" | 3 test "$1" && extra="-$1" |
4 | 4 |
5 # releases extract the version number from the VERSION file | |
6 version=$(cat VERSION 2> /dev/null) | |
7 | |
8 if test -z $version ; then | |
5 # Extract revision number from file used by daily tarball snapshots | 9 # Extract revision number from file used by daily tarball snapshots |
6 # or from the places different Subversion versions have it. | 10 # or from the places different Subversion versions have it. |
7 svn_revision=$(cat snapshot_version 2> /dev/null) | 11 svn_revision=$(cat snapshot_version 2> /dev/null) |
8 test $svn_revision || svn_revision=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2) | 12 test $svn_revision || svn_revision=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2) |
9 test $svn_revision || svn_revision=$(grep revision .svn/entries 2>/dev/null | cut -d '"' -f2) | 13 test $svn_revision || svn_revision=$(grep revision .svn/entries 2>/dev/null | cut -d '"' -f2) |
10 test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null) | 14 test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null) |
11 test $svn_revision && svn_revision=SVN-r$svn_revision | 15 test $svn_revision && svn_revision=SVN-r$svn_revision |
12 test $svn_revision || svn_revision=UNKNOWN | 16 test $svn_revision || svn_revision=UNKNOWN |
13 | 17 version=$svn_revision |
14 # releases extract the version number from the VERSION file | 18 fi |
15 version=$(cat VERSION 2> /dev/null) | |
16 test $version || version=$svn_revision | |
17 | 19 |
18 NEW_REVISION="#define VERSION \"${version}${extra}\"" | 20 NEW_REVISION="#define VERSION \"${version}${extra}\"" |
19 OLD_REVISION=$(head -n 1 version.h 2> /dev/null) | 21 OLD_REVISION=$(head -n 1 version.h 2> /dev/null) |
20 TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2011 MPlayer Team\n"' | 22 TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2011 MPlayer Team\n"' |
21 | 23 |