new beta-0.90.0
[luatex.git] / source / texk / web2c / luatexdir / getluatexsvnversion.sh
blob7728ec50ea9ebbc8037014987ec733882d978738
1 #! /bin/sh
2 # creates a c header file with the current subversion version
3 # This script should be run within the source directory.
5 $DEBUG
7 FILE="texk/web2c/luatexdir/luatex_svnversion.h"
9 LANG=C
10 if [ ! -r $FILE ]
11 then
12 echo '#define luatex_svn_revision -1' > $FILE
14 if ( svn info . >/dev/null 2>&1 && svnversion > /dev/null )
15 then
16 # svn up > /dev/null
17 DEFREV=`cat $FILE`
18 SVNREV=`svnversion -c . | sed -ne 's/^[0-9]*:*\([0-9]*\).*/#define luatex_svn_revision \1/p'`
19 test "$DEFREV" != "$SVNREV" && echo "$SVNREV" > $FILE
20 elif ( [ -f ../.git/refs/remotes/git-svn ] || [ -d ../.git/svn ] && git svn --version > /dev/null )
21 then
22 DEFREV=`cat $FILE`
23 SVNREV=`git svn info | sed -ne 's/^Revision: \([0-9]*\).*$/#define luatex_svn_revision \1/p'`
24 test "$DEFREV" != "$SVNREV" && echo "$SVNREV" > $FILE