#!/bin/sh
#
# As first documented in bug 6265161, sometimes packages for TS8
# and S8 have exactly the same VERSION string. This makes it
# possible to install the TS8 patches on Solaris 8
# unless the patch prevents that. This generic prepatch script checks
# that the Trusted_Solaris_8_HW_7/03 i386 version of package SUNWtsr
# is installed and aborts the patch installation if an attempt is made
# to install this patch on a Solaris 8 system (which wouldn't have SUNWtsr)
# or any other version of Trusted Solaris.
#

if [ "$PKG_INSTALL_ROOT" = "$ROOTDIR" ]; then
        PKG_INSTALL_ROOT=""
fi

NOVERS_MSG="PaTcH_MsG 8 Expected Trusted Solaris is not installed on this system."

export NOVERS_MSG

pkginfo -R ${PKG_INSTALL_ROOT:-"$ROOTDIR"} -v 2.5.0,REV=2003.11.11.20.36 -q SUNWtsr
status=$?
if [ $status -ne 0 ] ; then
	echo "\n\n"
	echo $NOVERS_MSG
	echo "Attempt to install Trusted Solaris patch ${PatchNum} on this system aborted."
	echo "\n\n"
	exit 1
fi;

exit 0
