[FFmpeg-devel] [PATCH] improve version.sh to support git

Benoit Fouet benoit.fouet
Sun Oct 14 15:45:15 CEST 2007


Aurelien Jacobs wrote:
> Hi,
>
> First attached patch contains some cosmetics for version.sh to make
> it more VCS agnostic.
>
> Second patch add support for git in version.sh (use short hash as
> version number). For now it's very simple and rely on the git command.
> It can probably be improved latter.
>
> Aurel
>   
> ------------------------------------------------------------------------
>
> --- version.sh.orig	2007-10-14 15:23:54.000000000 +0200
> +++ version.sh	2007-10-14 15:23:49.000000000 +0200
> @@ -1,11 +1,14 @@
>  #!/bin/sh
>  
> -svn_revision=`cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
> -test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
> -test $svn_revision || svn_revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
> -test $svn_revision || svn_revision=UNKNOWN
> +# check for SVN revision number
> +revision=SVN-r`cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
> +test $revision || revision=SVN-r`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
> +test $revision || revision=SVN-r`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
>  
> -NEW_REVISION="#define FFMPEG_VERSION \"SVN-r$svn_revision\""
> +# no version number found
> +test $revision || revision=UNKNOWN
> +
>   

won't all these tests always be true as you're now prefixing with "SVN-r" ?

-- 
Ben





More information about the ffmpeg-devel mailing list