# This script has been modified to remove desktop dependencies
# - tonylo 27/2/97
#
trap 'exit 3' 15
OUTPUT=$1
> ${OUTPUT}
SCRIPTS=/usr/sbin/pkginst
PKGMSG=${PKGINST}.pkg
LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
. ${SCRIPTS}/updebug
[ "$UPDEBUG" = YES ] && set -x
if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]; then
if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \
-d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]; then
cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \
/usr/lib/locale/${LOCALE}/LC_MESSAGES
fi
fi
#is it upgrade or overlay?
# ${SCRIPTS}/chkpkgrel returns
# 1 if installed pkg if UNK version
# 2 if installed pkg is SVR4.2
# 4 if installed pkg is SVR4.0 V4
# 6 if installed pkg is 2.0x (sbird)
# 9 if installed pkg is newer
# 0 if pkg is not installed
$SCRIPTS/chkpkgrel
case $? in
0) PKGINSTALL_TYPE=NEWINSTALL
AUTOMERGE=No
;;
2) PKGINSTALL_TYPE=OVERLAY
AUTOMERGE=Yes
;;
4) PKGINSTALL_TYPE=UPGRADE
message -d `pfmt -s nostd -g ${PKGMSG}:1 "Installed version of %s package must be removed before this version \ncan be installed." "${PKGINST}" 2>&1`
exit 3
;;
6) PKGINSTALL_TYPE=UPGRADE2
AUTOMERGE=Yes
;;
9) # Newer just do overlay
PKGINSTALL_TYPE=OVERLAY
AUTOMERGE=Yes
;;
*) # Don't allow install
message -d `pfmt -s nostd -g ${PKGMSG}:2 "The current installed version of %s could not be identified!\n You must remove the %s package before re-installing!" "${PKGINST}" "${PKGINST}" 2>&1`