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

Diego Biurrun diego at biurrun.de
Wed Apr 8 18:13:02 CEST 2009


On Sat, Apr 04, 2009 at 09:58:55PM +0200, Carl Eugen Hoyos wrote:
> 
> Attached is a patch against version.sh as suggested by Reimar.
> 
> Please comment, Carl Eugen

> --- 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

This will leave version.h lying around.  Remove it.

Diego



More information about the MPlayer-dev-eng mailing list