Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / am-utils / dist / m4 / update_build_version
blob35d4e1c9dfc4cf4fdb5f66a0677d0446ce3a9993
1 #!/bin/sh
2 # Update the build version file for am-utils
3 # Erez Zadok <ezk AT cs.columbia.edu>
4 #set -x
6 file="build_version.h"
7 vers=1
9 if test -f $file
10 then
11 egrep AMU_BUILD_VERSION $file | while read a b vers
13 vers=`expr $vers + 1`
14 echo '/* do not edit this file by hand */' > $file
15 echo '/* auto-generated by update_build_version script */' >> $file
16 echo '#define AMU_BUILD_VERSION '$vers >> $file
17 done
18 else
19 echo '/* do not edit this file by hand */' > $file
20 echo '/* auto-generated by update_build_version script */' >> $file
21 echo '#define AMU_BUILD_VERSION '$vers >> $file
24 if test -n "$USER"
25 then
26 build_user="$USER"
27 else
28 if test -n "$LOGNAME"
29 then
30 build_user="$LOGNAME"
31 else
32 build_user=`(whoami) 2>/dev/null` || build_user=unknown
35 echo '#define BUILD_USER "'$build_user'"' >> $file
37 build_host=`(hostname || uname -n) 2>/dev/null` || build_host=unknown
38 echo '#define BUILD_HOST "'$build_host'"' >> $file
40 build_date=`(date) 2>/dev/null` || build_date=unknown_date
41 echo '#define BUILD_DATE "'$build_date'"' >> $file