comparison version.sh @ 15650:5c5219508907

tabs --> spaces indentation cosmetics
author diego
date Sun, 05 Jun 2005 17:40:57 +0000
parents c3688869c2e5
children 5fa1221fb597
comparison
equal deleted inserted replaced
15649:c3688869c2e5 15650:5c5219508907
1 #!/bin/sh 1 #!/bin/sh
2 2
3 OS=`uname -s` 3 OS=`uname -s`
4 case "$OS" in 4 case "$OS" in
5 CYGWIN*|Linux) 5 CYGWIN*|Linux)
6 last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null` 6 last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null`
7 ;; 7 ;;
8 BSD/OS) 8 BSD/OS)
9 LS=`ls -lT CVS/Entries` 9 LS=`ls -lT CVS/Entries`
10 month=`echo $LS | awk -F" " '{print $6}'` 10 month=`echo $LS | awk -F" " '{print $6}'`
11 day=`echo $LS | awk -F" " '{print $7}'` 11 day=`echo $LS | awk -F" " '{print $7}'`
12 hms=`echo $LS | awk -F" " '{print $8}'` 12 hms=`echo $LS | awk -F" " '{print $8}'`
13 hour=`echo $hms | awk -F":" '{print $1}'` 13 hour=`echo $hms | awk -F":" '{print $1}'`
14 minute=`echo $hms | awk -F":" '{print $2}'` 14 minute=`echo $hms | awk -F":" '{print $2}'`
15 year=`echo $LS | awk -F" " '{print $9}'` 15 year=`echo $LS | awk -F" " '{print $9}'`
16 last_cvs_update="${year}${month}${day}-${hour}:${minute}" 16 last_cvs_update="${year}${month}${day}-${hour}:${minute}"
17 ;; 17 ;;
18 Darwin|*BSD) 18 Darwin|*BSD)
19 # BSD 'date -r' does not print modification time 19 # BSD 'date -r' does not print modification time
20 # LC_ALL=C sets month/day order and English language in the date string 20 # LC_ALL=C sets month/day order and English language in the date string
21 # The if in the awk call works around wrong day/month order. 21 # The if in the awk call works around wrong day/month order.
22 last_cvs_update=`LC_ALL=C ls -lT CVS/Entries | \ 22 last_cvs_update=`LC_ALL=C ls -lT CVS/Entries | \
23 awk '{ \ 23 awk '{ \
24 day=$7; \ 24 day=$7; \
25 month=index(" JanFebMarAprMayJunJulAugSepOctNovDec", $6); \ 25 month=index(" JanFebMarAprMayJunJulAugSepOctNovDec", $6); \
26 if(month==0) { \ 26 if(month==0) { \
27 day=$6; \ 27 day=$6; \
28 month=index(" JanFebMarAprMayJunJulAugSepOctNovDec",$7); } \ 28 month=index(" JanFebMarAprMayJunJulAugSepOctNovDec",$7); } \
29 printf("%s%.02d%.02d-%s", \ 29 printf("%s%.02d%.02d-%s", \
30 substr($9, 3, 2), (month+1)/3, day, substr($8, 0, 5)); \ 30 substr($9, 3, 2), (month+1)/3, day, substr($8, 0, 5)); \
31 }'` 31 }'`
32 ;; 32 ;;
33 *) 33 *)
34 last_cvs_update=`date +%y%m%d-%H:%M` 34 last_cvs_update=`date +%y%m%d-%H:%M`
35 ;; 35 ;;
36 esac 36 esac
37 37
38 extra="" 38 extra=""
39 if test "$1" ; then 39 if test "$1" ; then
40 extra="-$1" 40 extra="-$1"
41 fi 41 fi
42 echo "#define VERSION \"dev-CVS-${last_cvs_update}${extra}\"" >version.h 42 echo "#define VERSION \"dev-CVS-${last_cvs_update}${extra}\"" >version.h