3
# This script works out the revision number of the NWChem source
4
# code. It writes the resulting data in suboutine that can be used
5
# to query this information.
7
# We need 2 things for this operation to complete successfully:
8
# 1. svn needs to be available on this machine
9
# 2. the .svn directories need to be present in this source code
10
# If both these requirements are satisfied we will always overwrite
11
# the revision information with a current version.
12
# If either of these requirements is not satisfied we still need to
13
# make sure there is a valid version subroutine to ensure the code
14
# will compile. If such a routine already exists we do nothing as
15
# we lack the tools to do better than whatever is in that routine
16
# already. If such a routine does not exist we create one but
17
# setting the version number to blank (this is the best we can do).
19
# First find out where this script actually lives so we can create
20
# the appropriate Fortran file in the right location.
23
# The first item on the command line is an actual file so the
24
# script must have been specified including the path.
25
path="`dirname \"$0\"`"
27
# The first item on the command line is not a file so script
28
# it must have been found in PATH.
30
path="`dirname \"$path\"`"
32
my_svnversion=`which svn`
34
if [ -f "${my_svnversion}" ] ; then
35
# svnversion exists, but does .svn?
36
if [ -d ../../.svn ] ; then
38
revision=`${my_svnversion} info ../.. | grep Revision:`
39
revision=`echo ${revision} | sed 's/Revision: //'`
40
echo " subroutine util_nwchem_version(nwrev)" > util_nwchem_version.F
41
echo " implicit none" >> util_nwchem_version.F
42
echo " character*(*) nwrev" >> util_nwchem_version.F
43
echo " nwrev=\"${revision}\"" >> util_nwchem_version.F
44
echo " end" >> util_nwchem_version.F
46
if [ ! -f util_nwchem_version.F ] ; then
47
echo " subroutine util_nwchem_version(nwrev)" > util_nwchem_version.F
48
echo " implicit none" >> util_nwchem_version.F
49
echo " character*(*) nwrev" >> util_nwchem_version.F
50
echo " nwrev=\"N/A\"" >> util_nwchem_version.F
51
echo " end" >> util_nwchem_version.F
55
if [ ! -f util_nwchem_version.F ] ; then
56
echo " subroutine util_nwchem_version(nwrev)" > util_nwchem_version.F
57
echo " implicit none" >> util_nwchem_version.F
58
echo " character*(*) nwrev" >> util_nwchem_version.F
59
echo " nwrev=\"N/A\"" >> util_nwchem_version.F
60
echo " end" >> util_nwchem_version.F