#! /bin/sh
#
# Script to check if SUNWj3rt pkg is installed on the system. 
# If so, proceed to install the patch.  If not exit 1.
# 

    pkginfo -R $ROOTDIR -q SUNWdhcm
    get_dhcm_there=$?
    pkginfo -R $ROOTDIR -q SUNWdhcsu
    get_dhcsu_there=$?
    if [ $get_dhcm_there -ne 0 -a $get_dhcsu_there -ne 0 ]
    then
    # SUNWj3rt is irrelevant
  	exit 0
    fi
  
# Check if SUNWj3rt is on the system. 

    pkginfo -R $ROOTDIR -q SUNWj3rt 
    get_j3rt_there=$?
    
    if [ $get_j3rt_there -ne 0  ] 
    then
          echo ""
          echo "ERROR:  The SUNWj3rt package is a required package."
          echo "        Install the package and then re-apply this patch."
          echo ""
          exit 1

     fi       


exit 0 
