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-06-06 19:36:41 +00:00
|
|
|
CYGWIN*|Linux|MINGW*)
|
2005-06-05 17:40:57 +00:00
|
|
|
last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null`
|
|
|
|
;;
|
2005-06-06 17:51:44 +00:00
|
|
|
Darwin|*BSD*)
|
2005-06-05 17:40:57 +00:00
|
|
|
# BSD 'date -r' does not print modification time
|
|
|
|
# LC_ALL=C sets month/day order and English language in the date string
|
|
|
|
# The if in the awk call works around wrong day/month order.
|
|
|
|
last_cvs_update=`LC_ALL=C ls -lT CVS/Entries | \
|
|
|
|
awk '{ \
|
|
|
|
day=$7; \
|
|
|
|
month=index(" JanFebMarAprMayJunJulAugSepOctNovDec", $6); \
|
|
|
|
if(month==0) { \
|
|
|
|
day=$6; \
|
|
|
|
month=index(" JanFebMarAprMayJunJulAugSepOctNovDec",$7); } \
|
|
|
|
printf("%s%.02d%.02d-%s", \
|
|
|
|
substr($9, 3, 2), (month+1)/3, day, substr($8, 0, 5)); \
|
|
|
|
}'`
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
last_cvs_update=`date +%y%m%d-%H:%M`
|
|
|
|
;;
|
2002-12-31 18:23:52 +00:00
|
|
|
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
|
2005-06-05 17:40:57 +00:00
|
|
|
extra="-$1"
|
2002-09-20 12:50:04 +00:00
|
|
|
fi
|
2003-07-13 18:50:17 +00:00
|
|
|
echo "#define VERSION \"dev-CVS-${last_cvs_update}${extra}\"" >version.h
|