#!/sbin/sh
#------------------------------------------------------------------#
#
# (c)Copyright 1983-2001 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD checkinstall script template for 11.X patches.                 #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to prepare for a kernel build when required by the     #
# install conditions.  The script can also drive events that must  #
# occur before a system reboot occurs.                             #
#------------------------------------------------------------------#

_PATCHID=NEW_PATCH

UTILS="/usr/lbin/sw/control_utils"

if [ ! -f $UTILS ]; then
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

. $UTILS
exitval=$SUCCESS

#####
##### Insert any code you may require at this point in the script.
##### Pay attention to the exitval variable and set appropriately
##### in your code.  If you are unsure as to what types of operations
##### are legal in this file and what types aren't, consult the 
##### "Guidelines for SD Control Scripts" document.
#####
##### START_CUSTOMIZATION_HERE

#
# Do not install on 10.* systems. JAGad58269
#
rel_major=$(echo $(uname -r) | cut -f2 -d.)
if [ "$rel_major" = 10 ]
then
    grep os_release $SW_ROOT_DIRECTORY/.sw/sessions/swinstall.last >/dev/null 2>&1
    if [ $? -ne 0 ]
    then	
        echo "ERROR:   This patch can not be loaded on a 10.* system by itself."
        echo "         This patch will be pulled in during the 10.* to 11.00 update"
	echo "         Since this is not an update this patch is not loaded"
        exitval=$FAILURE
    fi
fi   	
#
#  Exit.
#
exit $exitval
