home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh -
- #
- # $Id: newvers.sh,v 5.1 89/11/17 18:18:27 jsp Exp Locker: jsp $
- #
- # Copyright (c) 1989 Jan-Simon Pendry
- # Copyright (c) 1989 Imperial College of Science, Technology & Medicine
- # Copyright (c) 1989 The Regents of the University of California.
- # All Rights Reserved.
- #
- # This code is derived from software contributed to Berkeley by
- # Jan-Simon Pendry at Imperial College, London.
- #
- # Redistribution and use in source and binary forms are permitted
- # provided that the above copyright notice and this paragraph are
- # duplicated in all such forms and that any documentation,
- # advertising materials, and other materials related to such
- # distribution and use acknowledge that the software was developed
- # by Imperial College of Science, Technology and Medicine, London, UK.
- # The names of the College and University may not be used to endorse
- # or promote products derived from this software without specific
- # prior written permission.
- # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- #
- # %W% (Berkeley) %G%
- #
- PATH=/usr/ucb:/bin:/usr/bin
- if [ $# -ne 1 ]; then echo "Usage: newvers program" >&2; exit 1; fi
- version="version.$1"
- if [ ! -r $version ]; then echo 0 > $version; chmod 444 $version; fi
- v=`cat $version`
- u=${USER-${LOGNAME-root}}
- h=`hostname`
- #h=`expr "$h" : '\([^.]*\)'`
- t=`date`
- r=`cat ../RELEASE`
- c=`sed 's/$/\\\\n\\\\/' ../COPYRIGHT`
- rm -f vers.$1.c
- cat > vers.$1.c << %%
- char version[] = "\\
- ${c}
- $1 ${r} #${v}: ${t}\\n\\
- Built by ${u}@${h}";
- %%
- rm -f $version
- /bin/echo `expr ${v} + 1` > $version
- chmod 444 $version
-