Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / svn_version.sh @ 32e6c218

History | View | Annotate | Download (679 Bytes)

1
#!/bin/bash
2

    
3
version=`svn info | awk -v ver="UNKNOWN" -F ":" '/R?vision/ { ver=$2 } END { print ver }' | tr -d " "`
4

    
5
if [ $version = 'UNKNOWN' ] ; then
6
  version=$(git rev-parse HEAD)
7
fi
8

    
9
if [ -z $version ] ; then
10
  version=UNKNOWN
11
fi 
12

    
13
filename=version.ml
14
prefix=$1
15

    
16
echo "Generating version information in file \"${filename}\" ..."
17

    
18
echo "" > src/${filename}
19
echo "(* Version file generated by Oasis *)" >> src/${filename}
20
echo "" >> src/${filename}
21
echo "let number = \"${version}\"" >> src/${filename}
22
echo "version number: ${version}"
23
echo "" >> src/${filename}
24
echo "let prefix = \"${prefix}\"" >> src/${filename}
25
echo "installation path prefix: ${prefix}"
26
echo "... done"