[MPlayer-dev-eng] [PATCH]Do not use head in version.sh

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Sat Apr 4 21:58:55 CEST 2009


Hi!

Attached is a patch against version.sh as suggested by Reimar.

Please comment, Carl Eugen
-------------- next part --------------
Index: version.sh
===================================================================
--- version.sh	(revision 29140)
+++ version.sh	(working copy)
@@ -16,13 +16,12 @@
 test $version || version=$svn_revision
 
 NEW_REVISION="#define VERSION \"${version}${extra}\""
-OLD_REVISION=$(head -n 1 version.h 2> /dev/null)
 TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2009 MPlayer Team\n"'
 
-# Update version.h only on revision changes to avoid spurious rebuilds
-if test "$NEW_REVISION" != "$OLD_REVISION"; then
-    cat <<EOF > version.h
+cat <<EOF > version.h.tmp
 $NEW_REVISION
 $TITLE
 EOF
-fi
+
+# Update version.h only on revision changes to avoid spurious rebuilds
+cmp -s version.h.tmp version.h || mv -f version.h.tmp version.h


More information about the MPlayer-dev-eng mailing list