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

Aurelien Jacobs aurel
Thu Oct 18 23:06:37 CEST 2007


Aurelien Jacobs wrote:

> On Sun, 14 Oct 2007 16:15:48 +0200
> Aurelien Jacobs <aurel at gnuage.org> wrote:
> 
> > On Sun, 14 Oct 2007 15:45:15 +0200
> > Benoit Fouet <benoit.fouet at purplelabs.com> wrote:
> > 
> > > 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" ?
> > 
> > Huh... indeed ! Feeling embarrassed...
> > I will try to provide a better patch.
> 
> Updated versions attached. Now works fine.

OK. No one care to comment ? Well, I will apply it very soon.

Aurel




More information about the ffmpeg-devel mailing list