

# Copyright \251 2004 Sun Microsystems, Inc. All rights reserved.
#
# Sun Microsystems, Inc. has intellectual property rights relating to
# technology embodied in the product that is described in this document.
# In particular, and without limitation, these intellectual property rights
# may include one or more of the U.S. patents listed at
# http://www.sun.com/patents and one or more additional patents or pending
# patent applications in the U.S. and in other countries.
#
# U.S. Government Rights - Commercial software. Government users are subject
# to the Sun Microsystems, Inc. standard license agreement and applicable
# provisions of the FAR and its supplements.
#
# Use is subject to license terms.
#
# This distribution may include materials developed by third parties. Sun,
# Sun Microsystems, the Sun logo, Java and Sun[tm] ONE are trademarks or
# registered trademarks of Sun Microsystems, Inc. in the U.S. and other
# countries.
#
# Copyright \251 2004 Sun Microsystems, Inc. Tous droits r\351serv\351s. Sun
# Microsystems, Inc. d\351tient les droits de propri\351t\351 intellectuels relatifs
# \340 la technologie incorpor\351e dans le produit qui est d\351crit dans ce document.
# En particulier, et ce sans limitation, ces droits de propri\351t\351
# intellectuelle peuvent inclure un ou plus des brevets am\351ricains list\351s
# \340 l'adresse http://www.sun.com/patents et un ou les brevets suppl\351mentaires
# ou les applications de brevet en attente aux Etats - Unis et dans les
# autres pays.
#
# L'utilisation est soumise aux termes du contrat de licence.
#
# Cette distribution peut comprendre des composants d\351velopp\351s par des
# tierces parties.
#
# Sun, Sun Microsystems, le logo Sun, Java et Sun[tm] ONE sont des marques
# de fabrique ou des marques d\351pos\351es de Sun Microsystems, Inc. aux
# Etats-Unis et dans d'autres pays.

RTM_VERSION="6.2-5"
ECHO="/bin/echo"


RPM=/bin/rpm
RPMDIR=.
# check Access Manager existance
rpm -q --quiet sun-identity-sdk
if [ $? -eq 0 ];then
    version=`rpm -q --queryformat "%{VERSION}-%{RELEASE}" sun-identity-sdk`
    if [ "$version" != "$RTM_VERSION" ];then
	$ECHO "`$gettext 'No Access Manager 6.2 RTM installed.'`"
	exit
    fi
else
   $ECHO "`$gettext 'No Access Manager installation found.'`"
   exit
fi

$ECHO "`$gettext 'Starting Upgrading AM 6.2 Packages'`"
installed="`$RPM -qa | grep sun-identity`"
for f in $installed
do
   name="`echo $f | sed -e "s/^\(..*\)\-[0-9]..*$/\1/"`"
   if [ -f ${RPMDIR}/$name-6* ]
   then
	case "${name}" in
	    sun-identity-console-sdk | sun-identity-sdk-config | sun-identity-services-config | sun-identity-mobileaccess-config)
		rpm -Uvh --nodeps --force ${RPMDIR}/$name-6*;;
	    *)	
		rpm -Uvh --prefix=${BASEDIR} --nodeps --force ${RPMDIR}/$name-6*;;
	esac
   fi
done

