summaryrefslogtreecommitdiffstats
path: root/src/common/global/svn_revision/svn_revision.sh
blob: 359056829462130b21c93ab137fb17e020b5f049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if [ -d .svn ]; then
  ( echo '// generated file';
  printf '#define SVN_REVISION "';
  (svnversion -n .);
  echo '"' ) > svn_revision.h.new;
  if [ ! -f svn_revision.h ]; then
    mv -f svn_revision.h.new svn_revision.h;
  else
    if cmp svn_revision.h svn_revision.h.new; then
      rm -f svn_revision.h.new;
    else
      mv -f svn_revision.h.new svn_revision.h;
    fi
  fi
fi
if [ ! -f svn_revision.h ]; then
  ( echo '// generated file';
    echo '#define SVN_REVISION "distribution"'; ) > svn_revision.h;
fi