changeset 8687:93694559178c

better BSD/OS support by Steven Schultz <sms@2bsd.com>
author alex
date Tue, 31 Dec 2002 18:23:52 +0000
parents ce29738fa891
children 28ab58268c35
files version.sh
diffstat 1 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/version.sh	Tue Dec 31 18:03:25 2002 +0000
+++ b/version.sh	Tue Dec 31 18:23:52 2002 +0000
@@ -1,13 +1,28 @@
 #!/bin/sh
 
-last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null`
-if test $? -ne 0 ; then
-        # probably no gnu date installed(?), use current date
-        last_cvs_update=`date +%y%m%d-%H:%M`
-elif test `uname -s` = 'Darwin' ; then
+OS=`uname -s`
+case "$OS" in
+     Linux)
+	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}"
+	;;
+     Darwin) 
         # darwin's date has different meaning for -r
-        last_cvs_update=`date +%y%m%d-%H:%M`
-fi
+	last_cvs_update=`date +%y%m%d-%H:%M`
+	;;
+     *)
+	last_cvs_update=`date +%y%m%d-%H:%M`
+	;;
+esac
 
 extra=""
 if test "$1" ; then