#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 18.3 $ generated on Fri Jun 15 15:20:51 PDT 2001
#
# (c)Copyright 1983-2001 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD checkremove script template for 11.X patches.                 #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to ensure that there is no patch specific restriction  #
# to removing the selected software from the target system.        #
#------------------------------------------------------------------#

_PATCHID=PHKL_23939

UTILS="/usr/lbin/sw/control_utils"

if [ ! -f $UTILS ]; then
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

. $UTILS
exitval=$SUCCESS

#####
##### Insert any code you may require at this point in the script.
##### Pay attention to the exitval variable and set appropriately
##### in your code.  If you are unsure as to what types of operations
##### are legal in this file and what types aren't, consult the 
##### "Guidelines for SD Control Scripts" document.
#####
##### START_CUSTOMIZATION_HERE

TachlitePatch="PHSS_23996"

# Check whether Tachlite driver is installed on the system
swlist -l fileset -a supersedes *.*,c=patch | grep -sq $TachlitePatch
#swlist -l fileset | grep -sq $Tachlite
if [ $? -eq 0 ]; then            # Tachlite driver is there

  # Is there any superseding patch installed?
  swlist -l fileset -a supersedes *.*,c=patch | grep -sq $_PATCHID | grep -q -v -E ^\ +$_PATCHID
  if [ $? -ne 0 ]; then          # No superseding patch have been detected

    exitval=$WARNING
    print -u2 "WARNING: $_PATCHID may be required by Tachlite patch $TachlitePatch"
    print -u2 "         or a superseding one. Removing $_PATCHID may affect the"
    print -u2 "         fixes implemented in this patch unless you have a patch"
    print -u2 "         superseding $_PATCHID installed."

  fi

fi

exit $exitval
