Adapt FFmpeg version.sh that only recreates version.h if its content changed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18787 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2006-06-22 13:47:50 +00:00
parent 57f3213401
commit 7dda786ccb
1 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,12 @@
#!/bin/sh
revision=r`grep revision .svn/entries | cut -d '"' -f 2 2> /dev/null`
test "$1" && extra="-$1"
echo "#define VERSION \"dev-SVN-${revision}${extra}\"" > version.h
svn_revision=`svn info | grep Revision | cut -d' ' -f2 || echo UNKNOWN`
NEW_REVISION="#define VERSION \"dev-SVN-r${svn_revision}${extra}\""
OLD_REVISION=`cat version.h 2> /dev/null`
# Update version.h only on revision changes to avoid spurious rebuilds
if test "$NEW_REVISION" != "$OLD_REVISION"; then
echo "$NEW_REVISION" > version.h
fi