GIT repositories: autogen.sh

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Fri Dec 28 13:24:31 CET 2007


Jasper Huijsmans wrote:
> ----
> diff --git a/autogen.sh b/autogen.sh
> index 5fb3634..fa3f072 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -29,7 +29,13 @@ EOF
> 
>  # substitute revision and linguas
>  linguas=`sed -e '/^#/d' po/LINGUAS`
> -revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
> +if [ `svn info $0 > /dev/null 2>&1` ]; then
> +  revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
> +elif [ -d ".git" ]; then
> +  revision=`LC_ALL=C awk '/branches-maxRev/ { printf "%05d\n", $3 }'
> .git/svn/.metadata`
> +else
> +  revision="(unknown)"
> +fi
>  sed -e "s/@LINGUAS@/${linguas}/g" \
>      -e "s/@REVISION@/${revision}/g" \
>      < "configure.in.in" > "configure.in"
> ----

This is what I'm using:

# substitute revision and linguas
if test -d .git/svn; then
  revision=`LC_ALL=C git-svn find-rev HEAD`
else
  revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n",
$2}'`
fi
sed -e "s/@REVISION@/${revision}/g" \
    < "configure.in.in" > "configure.in"

Requires git-svn of course... dunno how Brians repository works, so this
might not be appropriate.

Benedikt



More information about the Xfce4-dev mailing list