#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 18.3 $ generated on Fri Jun  1 01:11:43 MDT 2001
#
# (c)Copyright 1983-2001 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD preremove script template for 11.X patches.                   #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to perform any necessary actions not done in the       #
# unconfigure script in preparation for removal of the patch's     #
# files.                                                           #
#------------------------------------------------------------------#

PATH=/sbin:/usr/sbin:$PATH:/usr/bin
_PATCHID=PHSS_23546

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
#
# swmodify the GAGTAR file into existence so the
# patch can be removed.
#
GAGTAR="/opt/graphics/common/doc/GAG/GAG-11.0.tar"
if [ ! -f ${GAGTAR} ]
then
    echo "PLACE HOLDER" > ${GAGTAR}
fi
swlist -l fileset | grep X11-SERV-MAN > /tmp/swlist.out
while read line
do
    prod_fs=`echo $line | awk ' { print $1 } '`
    swmodify -xfiles=${GAGTAR} $prod_fs
done < /tmp/swlist.out
rm -f /tmp/swlist.out

exit $exitval
