#
# $Source: /project/fspro/patch/sol/META/prepatch,v $
# $Id: prepatch,v 1.1.2.2 2003/07/26 00:35:22 hchen Exp $
# $Copyrights: Copyright (c) 2001 - 2003 VERITAS Software Corporation.
# All rights reserved.
# VERITAS, the VERITAS Logo and all other VERITAS product names and
# slogans are trademarks or registered trademarks of VERITAS Software
# Corporation. VERITAS and the VERITAS Logo Reg. U.S. Pat. & Tm. Off.
# Other product names and/or slogans mentioned herein may be trademarks or
# registered trademarks of their respective companies.
#
# UNPUBLISHED - RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF THE UNITED
# STATES.  USE OF A COPYRIGHT NOTICE IS PRECAUTIONARY ONLY AND DOES NOT
# IMPLY PUBLICATION OR DISCLOSURE.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
# VERITAS SOFTWARE.  USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT
# THE PRIOR EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
#
# The Licensed Software and Documentation are deemed to be "commercial
# computer software" and "commercial computer software documentation" as
# defined in FAR Sections 12.212 and DFARS Section 227.7202.  $
#

#
# Perform prepatch processing for the VRTSfspro patch.
#

#
# We do a little dirty trick here. When we build the patch, in the
# build environment, we will have VRTSfspro.README. But this is not
# what 'readme_file' would get set to! Remember this script gets
# executed on the target box and so readme_file would get set
# to README.patchid. That README.patchid file gets built during
# patch build and will have the target solaris version number that
# it is meant for. So correct check happens.
readme_file=`ls |grep README`
machine_osver=`uname -r`
patch_osver=`grep "SunOS Release:" $readme_file|awk '{ print $3 }'`
patchno=`ls|grep REA*|cut -d"." -f2`
if [ $machine_osver != $patch_osver ]
then
	echo ""
	echo "The patch number $patchno can only be applied to"
	echo "Solaris $patch_osver. Please contact VERITAS Software to"
	echo "obtain the correct patch for your version of VRTSfspro for"
	echo "Solaris $machine_osver."
	echo ""
	exit 1
fi
exit 0
