Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: tags/R-2-2-0
Fetching contributors…

Cannot retrieve contributors at this time

executable file 53 lines (50 sloc) 1.613 kB
#!/bin/sh
#
# ${RHOME}/tools/GETVERSION
TOOLS_DIR=`echo ${0} | sed 's%/[^/][^/]*$%%'`
(
maj=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\1/' < ${TOOLS_DIR}/../VERSION`
min=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\2/' < ${TOOLS_DIR}/../VERSION`
rev=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\3/' < ${TOOLS_DIR}/../VERSION`
pl=`echo ${min} | sed 's/\..*//'`
sl=`echo ${min} | sed 's/.*\.//'`
ver=`expr ${maj} \\* 65536 + ${pl} \\* 256 + ${sl}`
if test -f ../../SVN-REVISION ; then
dat=`sed -e 1d -e 's/^Last Changed Date: //' ../../SVN-REVISION`
y=`echo ${dat} | cut -d- -f1`
m=`echo ${dat} | cut -d- -f2`
d=`echo ${dat} | cut -d- -f3`
y1=`expr ${y} - 2000`
svn_rev=`sed -n -e 's/^Revision: //' -e '1p' < ../../SVN-REVISION`
else
y=2001
m=01
d=01
y1=5
svn_rev=unknown
fi
echo "/* Rversion.h. Generated automatically. */"
echo "#ifndef R_VERSION_H"
echo "#define R_VERSION_H"
echo
echo '#ifdef __cplusplus'
echo 'extern "C" {'
echo '#endif'
echo
echo "#define R_VERSION ${ver}"
echo "#define R_Version(v,p,s) (((v) * 65536) + ((p) * 256) + (s))"
echo "#define R_MAJOR \"${maj}\""
echo "#define R_MINOR \"${min}\""
echo "#define R_STATUS \"${rev}\""
echo "#define R_YEAR \"${y}\""
echo "#define R_MONTH \"${m}\""
echo "#define R_DAY \"${d}\""
echo "#define R_SVN_REVISION \"${svn_rev}\""
## Using 1-digit year stops problems with leading zeros
echo "#define R_FILEVERSION ${maj},${pl}${sl},${y1}${m}${d},0"
echo
echo '#ifdef __cplusplus'
echo '}'
echo '#endif'
echo
echo "#endif /* not R_VERSION_H */")
Jump to Line
Something went wrong with that request. Please try again.