#! /bin/sh

LANG=C
export LANG

svnrev='Unknown'
if [ -d .svn ]
then
    if [ -x ${HOME}/bin/svn ]
    then
      SVN=${HOME}/bin/svn
    else
      SVN=svn
    fi
    svnrev=`${SVN} info | awk '/Revision/{print $2}'`
elif [ -d .git ]
then
    svnrev=`git show HEAD | perl -lne 'print $1 if /git-svn-id.+advene.trunk@(\d+)/'`
fi

builddate=`date +%Y%m%d`

perl -pi -e "s/date=.+/date='$builddate'/; s/svn=.+/svn='$svnrev'/" lib/advene/core/version.py

