]> Dogcows Code - chaz/tint2/blob - get_svnrev.sh
*fix* use /bin/sh because not every system has /bin/bash
[chaz/tint2] / get_svnrev.sh
1 #!/bin/sh
2
3 FALLBACK=\"0.10-svn\"
4
5 if [[ $# -eq 0 ]]; then
6 DIR=.
7 else
8 DIR=$1
9 fi
10
11 if [[ -f version.h ]]; then
12 REV_OLD=$(cat version.h | cut -d" " -f3)
13 else
14 REV_OLD=""
15 fi
16
17 if [[ -x "$(which svnversion 2>/dev/null)" && -d "${DIR}/.svn" ]] ; then
18 REV=\"$(svnversion -n ${DIR})\"
19 else
20 REV=${FALLBACK}
21 fi
22
23 if [[ ${REV_OLD} != ${REV} ]]; then
24 echo "Building new version.h"
25 echo "#define VERSION_STRING ${REV}" > version.h
26 fi
27
28
This page took 0.030677 seconds and 5 git commands to generate.