view version.sh @ 9009:f2d4324561b2

1) Removed the code to remove {} from sub_read_line_ssa 2) Put this code in a separated function: sub_pp_ssa 3) After recoding added a call to sub_pp_ssa. To be more acqurate: I added a pointer to function to hold a postprocessing function to be invoked after using iconv. There are one pointer for each format, if this pointer isn.t NULL the post processing function is called. patch by Salvador Eduardo Tropea <salvador@inti.gov.ar> help by <hephooey@fastmail.fm>
author arpi
date Sun, 19 Jan 2003 00:54:55 +0000
parents 93694559178c
children 3cb3620bab87
line wrap: on
line source

#!/bin/sh

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`
	;;
     *)
	last_cvs_update=`date +%y%m%d-%H:%M`
	;;
esac

extra=""
if test "$1" ; then
 extra="-$1"
fi
echo "#define VERSION \"CVS-${last_cvs_update}${extra} \"" >version.h