#! /sbin/sh
###############
# Product: HPVM
# Fileset: HPVM-CORE
# update_prep
# @(#) $Revision: 7737 $
################
#
# (c) Copyright Hewlett-Packard Company, 2005
#
########################################################################
#                                                                      #
# The global variables SUCCESS, FAILURE, WARNING, EXCLUDE, PATH, ROOT,
# SW_CTL_SCRIPT_NAME, _pf, PRODUCT, and FILESET are all set by control_utils.
########################################################################

UTILS="/var/adm/sw/pre_update/preUpdate_utils"
if [[ ! -f $UTILS ]]
then
    msg error "Cannot find the sh functions library $UTILS"
    exit 1
fi
. $UTILS

exitval=$SUCCESS                # Anticipate success


###########################################################################
# Remove T2767AC and 3.0 VMMigrate if installed
##########################################################################

if [[ "$SW_SESSION_IS_DRD" = 1 ]]
then
    : # skip for DRD
else
    if swlist | grep -q VMMigrate
    then
	swremove -x autoreboot=true -x enforce_dependencies=false VMMigrate
	retval=$?
	if [ ! $retval -eq 0 ]
	then
	   msg error "Cannot remove VMMigrate product. This may result in Update failure."
	fi
    fi
    if swlist | grep -q T2767AC
    then
	swremove -x autoreboot=true -x enforce_dependencies=false T2767AC 
	retval=$?
	if [ ! $retval -eq 0 ]
	then
	   msg error "Cannot remove T2767AC product. This may result in Update failure."
	fi
    fi
fi

##########################################################################
# Exit status
##########################################################################


exit $exitval
