#!/bin/ksh

################################################################################
# This prebackout script is created in-order to solve the following problem
# in the local zone
#
#WARNING: /usr/bin/cputrack <no longer a linked file>
#pkgadd: ERROR: unable to create unique temporary file </usr/bin/cputrack9AaaWj>
#Installation of <SUNWcpcu> partially failed.
################################################################################

Quiet() {
        typeset -r cmd_n_args=$*
	 eval "$cmd_n_args" > /dev/null 2>&1
}

if [ "$ROOTDIR" = '/' ] ; then
	typeset -r RT_DIR=$ROOTDIR
else
	typeset -r RT_DIR="$ROOTDIR/"
fi

typeset -r cpu_pkg=SUNWcpcu
typeset -r cpu_dir=$ROOTDIR/usr/bin
typeset -r cpu_track=$cpu_dir/cputrack

################################################################################
# Regardless of the zone type, remove the cputrack entry from the contents DB
################################################################################

Quiet removef -R $ROOTDIR $cpu_pkg ${RT_DIR}usr/bin/cputrack
Quiet removef -R $ROOTDIR -f $cpu_pkg

exit 0
