[Ffmpeg-devel] [PATCH]version.sh don't work if svn command unavailable. Rewriting of search in .svn/entries
Dujardin Bernard
dujardin.iut
Thu Feb 22 20:43:43 CET 2007
When svn is unavailable version.sh fall on this grep search
test $svn_revision || svn_revision=`cd "$1" && grep revision
.svn/entries | \
cut -d '"' -f2 2> /dev/null`
Problem : the word 'revision' is not in the file .svn/entries
Here the head of this file :
8
dir
8077
svn://svn.mplayerhq.hu/ffmpeg/trunk
...
I have replace the grep by this sed script based on existence of
the 3 last lines above
test $svn_revision || svn_revision=`cd "$1" && sed -ne '/^dir$/ \
{;n;h;n;/^svn:\/\/svn.mplayerhq.hu\/ffmpeg\/trunk$/ \
! d;x;p;}' .svn/entries 2>/dev/null`
A brief explanation of above :
sed -ne '
#find 'dir'
/^dir$/ \
get next line and store
n
h
#get next line
n
#match svn:svn.mplayerhq.hu/ffmpeg/trunk ?
/^svn:\/\/svn.mplayerhq.hu\/ffmpeg\/trunk$/
#no delete
! d
#yes restore previous line
x
#print result
p
}' .svn/entries 2>/dev/null`
In hope is help. Patch attached
Regards
Bernard
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: version_sh_8080.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070222/f77cdf1d/attachment.txt>
More information about the ffmpeg-devel
mailing list