#! /bin/sh 
#
# Copyright (c) 2002-2003 by Sun Microsystems, Inc.
# All rights reserved.
#
#
#
# Check for SUNWsan

pkginfo -R $ROOTDIR SUNWsan > /dev/null 2>&1
if [ $? -ne 0 ] ; then

  echo
  echo
  echo "Patch installation FAILED."
  echo
  echo "This patch requires the installation of \c"
  echo "the Sun SAN Foundation Kit, SUNWsan."
  echo
  echo "Please load the package SUNWsan before continuing \c"
  echo "with this patch installation."
  echo

  exit 1

fi

# Check for SUNWqlc
pkginfo -R $ROOTDIR SUNWqlc > /dev/null 2>&1
if [ $? -ne 0 ] ; then	

  # SUNWqlc not installed
	
  # Is 64 bit installed ?
  pkginfo -R $ROOTDIR SUNWcarx > /dev/null 2>&1
  if [ $? -eq 0 ] ; then
    # 64 bit installed

     
    # Is SUNWqlcx installed ?
    pkginfo -R $ROOTDIR SUNWqlcx > /dev/null 2>&1 
    sparcv9=$?			
  
  else	
    # 64 bit not installed
    sparcv9=0
  fi

  echo "This patch requires the installation of the package(s):\n"
  echo "\tSUNWqlc, Qlogic ISP 2200/2202 Fibre Channel Device Driver."
  
  [ $sparcv9 -ne 0 ] && echo "\tSUNWqlcx, Qlogic ISP 2200/2202 Fibre Channel Device Driver (64bit)."
  
  echo
  echo "Please load the package(s) SUNWqlc \c"
  [ $sparcv9 -ne 0 ] && echo "and SUNWqlcx \c"
  echo "\nbefore continuing with this patch installation."
  echo
  exit 1
fi
