144631Smckusick#!/bin/sh - 244631Smckusick# 344631Smckusick# Copyright (c) 1989 Jan-Simon Pendry 444631Smckusick# Copyright (c) 1989 Imperial College of Science, Technology & Medicine 561785Sbostic# Copyright (c) 1989, 1993 661785Sbostic# The Regents of the University of California. All Rights Reserved. 744631Smckusick# 844631Smckusick# This code is derived from software contributed to Berkeley by 944631Smckusick# Jan-Simon Pendry at Imperial College, London. 1044631Smckusick# 1144631Smckusick# %sccs.include.redist.sh% 1244631Smckusick# 13*61788Sbostic# @(#)newvers.sh 8.1 (Berkeley) 06/06/93 1444631Smckusick# 1552452Spendry# $Id: newvers.sh,v 5.2.2.1 1992/02/09 15:11:19 jsp beta $ 1649685Spendry# 1747535SpendryPATH=/usr/ucb:/bin:/usr/bin:$PATH 1847535Spendryif [ $# -ne 3 ]; then echo "Usage: newvers program arch os" >&2; exit 1; fi 1944631Smckusickversion="version.$1" 2044631Smckusickif [ ! -r $version ]; then echo 0 > $version; chmod 444 $version; fi 2144631Smckusickv=`cat $version` 2244631Smckusicku=${USER-${LOGNAME-root}} 2344631Smckusickh=`hostname` 2444631Smckusick#h=`expr "$h" : '\([^.]*\)'` 2544631Smckusickt=`date` 2649685Spendryif [ ! -s "$d../config/RELEASE" -o ! -s "$d../text/COPYRIGHT" ]; then 2744631Smckusick echo ERROR: config file missing >&2 2844631Smckusick exit 1 2944631Smckusickfi 3044631Smckusickrm -f vers.$1.c 3147535Spendry( 3247535Spendrycat << %% 3347535Spendrychar copyright[] = "\\ 3447535Spendry%% 3547535Spendrysed 's/$/\\n\\/' $d../text/COPYRIGHT 3647535Spendrycat << %% 3747535Spendry"; 3844631Smckusickchar version[] = "\\ 3944631Smckusick%% 4047535Spendrycat << %% 4147535Spendry$1 \\ 4247535Spendry%% 4347535Spendrysed \ 4447535Spendry -e 's/\$//g' \ 4547535Spendry -e 's/[A-Z][a-z]*://g' \ 4647535Spendry -e 's/ */ /g' \ 4747535Spendry -e 's/^ //' \ 4847535Spendry -e 's/$/\\/' \ 4947535Spendry $d../config/RELEASE 5047535Spendrycat << %% 5147535Spendry #${v}: ${t}\\n\\ 5247535SpendryBuilt by ${u}@${h} for \\ 5347535Spendry%% 5447535Spendrycase "$2" in 5547535Spendry[aeiou]*) echo "an \\" ;; 5647535Spendry*) echo "a \\";; 5747535Spendryesac 5847535Spendryecho "$2 running $3\";" 5947535Spendry) > vers.$1.c 6044631Smckusickrm -f $version 6147535Spendryexpr ${v} + 1 > $version 6244631Smckusickchmod 444 $version 63