Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | # This file is taken from the MPlayer sources, and adapted a little bit.
|
---|
4 | # It gets the SVN revision number and then saves it in two files:
|
---|
5 | # src/svn_revision.h and svn_revision
|
---|
6 |
|
---|
7 | test "$1" && extra="-$1"
|
---|
8 |
|
---|
9 | svn_revision=`LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
|
---|
10 | test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
|
---|
11 | test $svn_revision || svn_revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
|
---|
12 | test $svn_revision || svn_revision=0UNKNOWN
|
---|
13 |
|
---|
14 | NEW_REVISION="#define SVN_REVISION \"SVN-r${svn_revision}${extra}\""
|
---|
15 | OLD_REVISION=`cat src/svn_revision.h 2> /dev/null`
|
---|
16 |
|
---|
17 | # Update version.h only on revision changes to avoid spurious rebuilds
|
---|
18 | if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
---|
19 | echo "$NEW_REVISION" > src/svn_revision.h
|
---|
20 | echo "SVN-r${svn_revision}${extra}" > svn_revision
|
---|
21 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.