xref: /original-bsd/usr.sbin/amd/config/newvers.sh (revision baf24c0d)
1#!/bin/sh -
2#
3# $Id: newvers.sh,v 5.2 90/06/23 22:21:21 jsp Rel $
4#
5# Copyright (c) 1989 Jan-Simon Pendry
6# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
7# Copyright (c) 1989 The Regents of the University of California.
8# All Rights Reserved.
9#
10# This code is derived from software contributed to Berkeley by
11# Jan-Simon Pendry at Imperial College, London.
12#
13# %sccs.include.redist.sh%
14#
15#	@(#)newvers.sh	5.2 (Berkeley) 07/29/90
16#
17PATH=/usr/ucb:/bin:/usr/bin
18if [ $# -ne 1 ]; then echo "Usage: newvers program" >&2; exit 1; fi
19version="version.$1"
20if [ ! -r $version ]; then echo 0 > $version; chmod 444 $version; fi
21v=`cat $version`
22u=${USER-${LOGNAME-root}}
23h=`hostname`
24#h=`expr "$h" : '\([^.]*\)'`
25t=`date`
26r=`cat $d../config/RELEASE`
27c=`sed 's/$/\\\\n\\\\/' $d../text/COPYRIGHT`
28if [ -z "$r" -o -z "$c" ]; then
29	echo ERROR: config file missing >&2
30	exit 1
31fi
32rm -f vers.$1.c
33cat > vers.$1.c << %%
34char version[] = "\\
35${c}
36$1 ${r} #${v}: ${t}\\n\\
37Built by ${u}@${h}";
38%%
39rm -f $version
40/bin/echo `expr ${v} + 1` > $version
41chmod 444 $version
42