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

Aurelien Jacobs aurel
Sun Oct 14 16:26:55 CEST 2007


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.

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: version_1.diff
Type: text/x-diff
Size: 1129 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071014/96a0006e/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: version_2.diff
Type: text/x-diff
Size: 491 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071014/96a0006e/attachment-0001.diff>



More information about the ffmpeg-devel mailing list