2001-04-14 22:26:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-12-31 18:23:52 +00:00
|
|
|
OS=`uname -s`
|
|
|
|
case "$OS" in
|
2005-05-18 22:33:35 +00:00
|
|
|
CYGWIN*|Linux)
|
2002-12-31 18:23:52 +00:00
|
|
|
last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null`
|
|
|
|
;;
|
|
|
|
BSD/OS)
|
|
|
|
LS=`ls -lT CVS/Entries`
|
|
|
|
month=`echo $LS | awk -F" " '{print $6}'`
|
|
|
|
day=`echo $LS | awk -F" " '{print $7}'`
|
|
|
|
hms=`echo $LS | awk -F" " '{print $8}'`
|
|
|
|
hour=`echo $hms | awk -F":" '{print $1}'`
|
|
|
|
minute=`echo $hms | awk -F":" '{print $2}'`
|
|
|
|
year=`echo $LS | awk -F" " '{print $9}'`
|
|
|
|
last_cvs_update="${year}${month}${day}-${hour}:${minute}"
|
|
|
|
;;
|
2005-05-21 14:44:10 +00:00
|
|
|
Darwin|*BSD)
|
|
|
|
# BSD 'date -r' does not print modification time
|
2005-05-22 16:27:17 +00:00
|
|
|
# LC_ALL=C sets month/day order and English language in the date string
|
|
|
|
LS=`LC_ALL=C ls -lT CVS/Entries`
|
2005-05-18 21:55:52 +00:00
|
|
|
year=`echo $LS | cut -d' ' -f9 | cut -c 3-4`
|
|
|
|
month=`echo $LS | awk -F" " '{printf "%.2d", \
|
2005-05-21 14:44:10 +00:00
|
|
|
(index("JanFebMarAprMayJunJulAugSepOctNovDec",$6)+2)/3}'`
|
|
|
|
day=`echo $LS | cut -d' ' -f7`
|
2005-05-18 21:55:52 +00:00
|
|
|
hour=`echo $LS | cut -d' ' -f8 | cut -d: -f1`
|
|
|
|
minute=`echo $LS | cut -d' ' -f8 | cut -d: -f2`
|
|
|
|
last_cvs_update="${year}${month}${day}-${hour}:${minute}"
|
2002-12-31 18:23:52 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
last_cvs_update=`date +%y%m%d-%H:%M`
|
|
|
|
;;
|
|
|
|
esac
|
2001-12-03 19:13:34 +00:00
|
|
|
|
2002-09-20 12:50:04 +00:00
|
|
|
extra=""
|
2002-09-20 15:46:13 +00:00
|
|
|
if test "$1" ; then
|
2002-09-20 12:50:04 +00:00
|
|
|
extra="-$1"
|
|
|
|
fi
|
2003-07-13 18:50:17 +00:00
|
|
|
echo "#define VERSION \"dev-CVS-${last_cvs_update}${extra}\"" >version.h
|