#!/bin/sh
#
#	@(#)postinstall 1.4 00/07/23
#
# Copyright (c) 2000 Sun Microsystems, Inc.  All Rights Reserved.

#
# The "regconvert" utility will convert any pre-existing Solaris Product 
# Registry 2.0 database found on PKG_INSTALL_ROOT over to the current format
# for the Solaris Product Registry 3.0.
#
# If the regconvert conversion utility exists on this system, run it.  
# Use the regconvert "-b" batch option to dissable any user interaction
# requests and to dissable regconvert streaming conversion "% done" output.
#
if  [ -x /usr/sadm/install/bin/regconvert ]
then
	if [ "X$PKG_INSTALL_ROOT" != "X" ]; then
        	/usr/sadm/install/bin/regconvert -b -R $PKG_INSTALL_ROOT
	else
        	/usr/sadm/install/bin/regconvert -b
	fi

	status=$?
#
#       If regconvert has any problems it will output to standard out 
#       information about the problem and return a non-zero status.
#       If this occurs, return a WARNING status for this pkgadd. 
#
	if [ $status -ne 0 ]; then
		exit 2
	fi
fi

exit 0
