Rev | Line | |
---|
[107] | 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`
|
---|
[119] | 10 | test $svn_revision || svn_revision=`cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
|
---|
[107] | 11 | test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
|
---|
| 12 | test $svn_revision || svn_revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
|
---|
| 13 | test $svn_revision || svn_revision=0UNKNOWN
|
---|
| 14 |
|
---|
[119] | 15 | if test "$2"; then
|
---|
| 16 | extra="-$2"
|
---|
| 17 | fi
|
---|
[156] | 18 | NEW_REVISION="#define SVN_REVISION \"${svn_revision}${extra}\""
|
---|
[107] | 19 | OLD_REVISION=`cat src/svn_revision.h 2> /dev/null`
|
---|
| 20 |
|
---|
| 21 | # Update version.h only on revision changes to avoid spurious rebuilds
|
---|
| 22 | if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
---|
| 23 | echo "$NEW_REVISION" > src/svn_revision.h
|
---|
| 24 | echo "SVN-r${svn_revision}${extra}" > svn_revision
|
---|
| 25 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.