summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-22 13:47:50 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-22 13:47:50 +0000
commit7dda786ccba294de279dfd8e5581441c1b36c934 (patch)
tree6fc9b780f4743ace7f1ebbd3d823a41486f41708
parent57f3213401a8becec64d1eed7586fefe7c663c73 (diff)
downloadmpv-7dda786ccba294de279dfd8e5581441c1b36c934.tar.bz2
mpv-7dda786ccba294de279dfd8e5581441c1b36c934.tar.xz
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
-rwxr-xr-xversion.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/version.sh b/version.sh
index 026e51c60d..6a77cc415d 100755
--- a/version.sh
+++ b/version.sh
@@ -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