xref: /xnu-8796.141.3/SETUP/newvers (revision 1b191cb58250d0705d8a51287127505aa4bc0789)
1*1b191cb5SApple OSS Distributions#!/bin/sh -
2*1b191cb5SApple OSS Distributions#
3*1b191cb5SApple OSS Distributions# Mach Operating System
4*1b191cb5SApple OSS Distributions# Copyright (c) 1990 Carnegie-Mellon University
5*1b191cb5SApple OSS Distributions# Copyright (c) 1989 Carnegie-Mellon University
6*1b191cb5SApple OSS Distributions# All rights reserved.  The CMU software License Agreement specifies
7*1b191cb5SApple OSS Distributions# the terms and conditions for use and redistribution.
8*1b191cb5SApple OSS Distributions#
9*1b191cb5SApple OSS Distributions
10*1b191cb5SApple OSS Distributions#
11*1b191cb5SApple OSS Distributions# newvers.sh	copyright major minor variant
12*1b191cb5SApple OSS Distributions#
13*1b191cb5SApple OSS Distributions
14*1b191cb5SApple OSS Distributionsmajor="$1"; minor="$2"; variant="$3"
15*1b191cb5SApple OSS Distributionsv="${major}.${minor}" d=`pwd` h="rcbuilder" t=`date` w=`whoami`
16*1b191cb5SApple OSS Distributionsif [ -z "$d" -o -z "$h" -o -z "$t" ]; then
17*1b191cb5SApple OSS Distributions    exit 1
18*1b191cb5SApple OSS Distributionsfi
19*1b191cb5SApple OSS DistributionsCONFIG=`expr "$d" : '.*/\([^/]*\)$'`
20*1b191cb5SApple OSS Distributionsd=`expr "$d" : '.*/\([^/]*/[^/]*/[^/]*\)$'`
21*1b191cb5SApple OSS Distributions(
22*1b191cb5SApple OSS Distributions  /bin/echo "int  ${COMPONENT}_version_major      = ${major};" ;
23*1b191cb5SApple OSS Distributions  /bin/echo "int  ${COMPONENT}_version_minor      = ${minor};" ;
24*1b191cb5SApple OSS Distributions  /bin/echo "char ${COMPONENT}_version_variant[]  = \"${variant}\";" ;
25*1b191cb5SApple OSS Distributions  /bin/echo "char ${COMPONENT}_version[] = \"Security Component Version ${v}:\\n${t}; $w($h):$d\\n\";" ;
26*1b191cb5SApple OSS Distributions  /bin/echo "char ${COMPONENT}_osrelease[] = \"${major}.${minor}\";" ;
27*1b191cb5SApple OSS Distributions  /bin/echo "char ${COMPONENT}_ostype[] = \"Security Modules\";" ;
28*1b191cb5SApple OSS Distributions) > vers.c
29*1b191cb5SApple OSS Distributionsif [ -s vers.suffix -o ! -f vers.suffix ]; then
30*1b191cb5SApple OSS Distributions    rm -f vers.suffix
31*1b191cb5SApple OSS Distributions    echo ".${variant}.${CONFIG}" > vers.suffix
32*1b191cb5SApple OSS Distributionsfi
33*1b191cb5SApple OSS Distributionsexit 0
34