[go: up one dir, main page]

Menu

[r201]: / mia2 / mia / core / revision.sh  Maximize  Restore  History

Download this file

33 lines (26 with data), 961 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# only use this if we are in a subversion repository
[ -e ~/.profile ] && . ~/.profile
if [ "x$1" != "x." ] ; then
pushd $1
fi
if [ -d .svn ]; then
rev=`svn info | grep Revision`
val="#define LIBMIA_REVISION "\"$rev\"
echo $val >revision.hh.new
if diff revision.hh.new revision.hh >/dev/null 2>&1 ; then
rm -f revision_info.hh.new
else
mv revision.hh.new revision.hh
fi
elif [ ! -f revision.hh ] ; then
echo "WARNING: Unable to obtain revision number from subversion tree"
echo "WARNING: Either you're not using a working copy of the svn version"
echo "WARNING: or the subversion client is not available"
echo "WARNING: As a workaround you may create a 'revision.hh' by hand"
echo "WARNING: with the line '#define LIBMIA_REVISION \"unknown\"'"
echo "WARNING: build will fail with 'revision.cc: libmia/revision.hh: No such file or directory'"
fi
if [ "x$1" != "x." ] ; then
popd
fi