# This script deletes the used backout data for a patch package
# and removes the deletes file entries.
#
# directory format options.
#
#       @(#)patch_postinstall 1.3 98/07/29 SMI
#
# Copyright (c) 1995 by Sun Microsystems, Inc.
# All rights reserved
#

PATH=/usr/sadm/bin:$PATH
THIS_DIR=`dirname $0`

Our_Deletes=$THIS_DIR/deletes

#
# Delete the used backout data
#
if [ -f $Our_Deletes ]; then
	cat $Our_Deletes | while read path; do
		if valpath -l $path; then
			Client_Path=`echo "$CLIENT_BASEDIR/$path" | sed "s|//|/|"`
		else	# It's an absolute path
			Client_Path=$path
		fi
		rm `removef $PKGINST $Client_Path`
	done
	removef -f $PKGINST

	rm $Our_Deletes
fi

#
# Remove the deletes file, checkinstall and the postinstall
#
rm -r $PKGSAV/$ACTIVE_PATCH
rm -f $THIS_DIR/checkinstall $THIS_DIR/postinstall

echo $BASEDIR
echo $PKG_INSTALL_ROOT
BASEDIR=/opt/VRTSob
if [ -f /var/sadm/pkg/VRTSobgui/113595-04/jre.tar ]; then 
	cd $BASEDIR
	rm -rf jre
	tar -xf /var/sadm/pkg/VRTSobgui/113595-04/jre.tar 2>/dev/null
	chown -R root:other jre 2>/dev/null
	rm -rf /var/sadm/pkg/VRTSobgui/113595-04/jre.tar > /dev/null 2>&1
fi
#XXXSpecial_CommandsXXX#
