#! /bin/sh
#
# This script reminds the user to remove the entry which may have
# been manually added to /etc/system as documented in README.103955-04
# The message is only printed if the following conditions are met:
#
#   o /etc/system contains $ADDED_WORD
#      (part of entry: set fd:slavio_index_pulse_work_around = 0x1)
#   o The target system does not have 103955-04 installed
#     ie, backing out a higher rev if -04 is still installed
#         will not print the message
 
PKG_INSTALL_ROOT=$ROOTDIR
PKG=SUNWcar
PATCHID=103955-04
ADDED_WORD="fd:slavio_index_pulse_work_around"
HAS_04=`pkgparam -R $ROOTDIR $PKG PATCHLIST | egrep "$PATCHID"`

if [ "$ROOTDIR" = / ]; then
	SYS_FILE=${PKG_INSTALL_ROOT}etc/system
else
        SYS_FILE=${PKG_INSTALL_ROOT}/etc/system
fi

TEXT_FOUND=`egrep "$ADDED_WORD" $SYS_FILE`
 
if [ -n "$TEXT_FOUND" ] && [ -z "$HAS_04" ]; then
   echo "Please edit $SYS_FILE and remove this entry:"
   echo "$TEXT_FOUND"
fi
exit 0

