#!/sbin/sh

########
# Product:  GraphicsCommon
# Fileset:  STAR-RUN
# configure
#
# $Source: /hmstmp/update.25011/./release/SD/GraphicsCommon/STAR-RUN/postinstall,v $
# $Revision: 550.2 $
# $Date: 96/07/16 11:09:44 $
#
########
#
# (c) Copyright Hewlett-Packard Company 1994
#
########

	set -a       					# export all vars
	exitval=0					# anticipate success

	UTILS="/usr/lbin/sw/control_utils"
	if [[ ! -f $UTILS ]]
	then
		echo "ERROR:    Cannot find UTILS"
		exit 1
	fi
	. $UTILS

################################################################################
#set -x # For debugging purposes.  _Never_ ship uncommented!!


	SW_INSTALL_DIR="/"

	##
	## Test to see if either SW_ROOT_DIRECTORY or SW_LOCATION is
	## set to something other than /.  If so, set up SW_INSTALL_DIR
	## so it will not have spurious /'s in the path name.
	##
	
	if [ $SW_ROOT_DIRECTORY != / -o $SW_LOCATION != / ]
	then
		if [ $SW_ROOT_DIRECTORY != / ]
		then
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}${SW_LOCATION}"
			else
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}"
			fi
		else
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_LOCATION}"
			fi
		fi
	fi

	DEFAULTS_FILE="config/defaults"

	##
	## The old defaults file was saved away during the running of the
	## preinstall script.  Now, time to move the new one into place if
	## appropriate.  All this is handled by the newconfig_cp and
	## newconfig_msgs utility functions.  newconfig_msgs interprets the
	## return value from newconfig_cp and emits the appropriate notes
	## and/or warnings.
	##

	newconfig_cp ${SW_LOCATION}${DEFAULTS_FILE}
	STATUS=$?
	newconfig_msgs $STATUS

	exit $exitval
################################################################################
