#!/bin/sh
#
# @(#)preinstall 1.1	 97/11/06 SMI


EXEC_BASE=/usr

remove_bool=0

#if [ -d ${BASEDIR}/openwin/share/locale/en_US ]; then
#      rm -r ${BASEDIR}/openwin/share/locale/en_US
#fi

for PKG in SUNWdodte SUNWeodte SUNWfodte SUNWiodte SUNWsodte; do
	pkgparam  $PKG ARCH  > /dev/null 2>&1
	exist=$?
	if [ $exist != 0 ] ; then
		remove_bool=1
		continue
	fi
done

if [ $remove_bool = 1 ]; then
	for LOC in en_CA en_US es_MX; do
		if [ -d ${BASEDIR}/openwin/share/locale/${LOC} ]; then		
			if [ -d ${BASEDIR}/openwin/share/locale/${LOC}/props ]; then
				if [ -f ${BASEDIR}/openwin/share/locale/${LOC}/props/basic_setting ]; then
					rm -f ${BASEDIR}/openwin/share/locale/${LOC}/props/basic_setting > /dev/null 2>&1
				fi
				rmdir ${BASEDIR}/openwin/share/locale/${LOC}/props > /dev/null 2>&1
			fi
			rmdir ${BASEDIR}/openwin/share/locale/${LOC} > /dev/null 2>&1
		fi
	done
fi

exit 0
