#!/bin/sh
#
# @(#)getOSFinstdir	1.3	LPS_UNX_COM	02/16/95
#
# RCS $Id: getOSFinstdir 1.2 1997/11/06 15:45:14 jds Exp $
#
#
# getOSFinstdir
#
# Script to derive the proper OSF/1 installation directory path
# based on the specified LPS release number.
#
############################################################
# WRONG!!!  This script derives the OSF/1 Kit/subset name of
#           LPSBASEmnu (mnu is major, minor, update).
#           The previous version of this script was also wrong
#	    in reporting a directory of /opt/LPSBASE0mn.  While
#	    the proper OSF/1 thing to do would be to use 
#	    /usr/opt/LPSmnu, we always use /usr/opt/LPS to simplify
#	    kit updates.
############################################################
#
#
# Parameters:
#    $1 - LPS release number, eg: "5.1"
#
# Global variables:
#    --none--
#
# Exit values:
#    0 - Success, the path was written to stdout.
#    1 - Error, all messages go to stderr.
###
 
SYSVERSION="$1"

# The form of the system version we expect is VERY RIGID and must
# be in the form "m.n" (eg, "5.1").  Anything else...and we BARF.

if [ -z "$SYSVERSION" -o `expr "$SYSVERSION" : '.*'` -ne 3 ]
then
    cat <<EOF  1>&2
    Invalid LPS system version string: $SYSVERSION

    Unable to derive the OSF/1 installation directory path!

    Press RETURN to continue...
EOF
    pause
    exit 1
fi

# Suffix is a 3 digit version number in the form of "mnu" where
# m=major n=minor u=update (update is always zero for LPS kits).
#
suffix="`echo $SYSVERSION | cut -c1,3`0"  # Produces "mn0"

echo "LPSBASE$suffix"

exit 0
