[go: up one dir, main page]

Menu

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

Download this file

28 lines (22 with data), 947 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
#!/bin/bash
# only use this if we are in a subversion repository
[ -e ~/.profile ] && . ~/.profile
if [ -d $1/.svn ]; then
pushd $1
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
popd
elif [ ! -f $1/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 in the <source root>/mia/core directory"
echo "WARNING: with the line '#define LIBMIA_REVISION \"unknown\"'"
echo "WARNING: otherwise build will fail with 'revision.cc: revision.hh: No such file or directory'"
fi