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

PATH=/usr/bin:/usr/sbin

if [ "$BASEDIR" = "/" ]; then
	#
	# First make sure there are no solaris9 branded zones.
	#
	zoneadm list -cp | nawk -F: '{if ($6 == "solaris9") exit 1}'
	if [ $? -ne 0 ]; then
		echo "There are solaris9 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/solaris9/s9_servicetag -X -R $BASEDIR

exit 0
