#!/bin/sh
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)preremove	1.5	08/03/18 SMI"

PATH=/usr/bin:/usr/sbin

if [ "$BASEDIR" = "/" ]; then
	#
	# First make sure there are no solaris8 branded zones.
	#
	zoneadm list -cp | nawk -F: '{if ($6 == "solaris8") exit 1}'
	if [ $? -ne 0 ]; then
		echo "There are solaris8 branded zones configured; " \
		    "unable to remove package."
		exit 1
	fi
fi

#
# Attempt to clean up any remaining service tags for this product.
#
/usr/lib/brand/solaris8/s8_servicetag -X -R $BASEDIR

exit 0
