home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nwnet / install / request < prev   
Text File  |  1998-08-19  |  2KB  |  67 lines

  1. #!/bin/sh
  2. #ident    "@(#)request    1.2"
  3. #ident    "$Header: /SRCS/esmp/usr/src/nw/pkg/nwnet/request,v 1.7 1995/10/09 22:34:02 vtag Exp $"
  4.  
  5. #
  6. # This script has been modified to remove desktop dependencies
  7. # - tonylo 27/2/97
  8. #
  9.  
  10. trap 'exit 3' 15
  11. OUTPUT=$1
  12. > ${OUTPUT}
  13.  
  14. SCRIPTS=/usr/sbin/pkginst
  15. PKGMSG=${PKGINST}.pkg
  16. LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
  17. . ${SCRIPTS}/updebug
  18. [ "$UPDEBUG" = YES ] && set -x
  19.  
  20. if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]; then
  21.     if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \
  22.          -d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]; then
  23.         cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \
  24.            /usr/lib/locale/${LOCALE}/LC_MESSAGES
  25.     fi
  26. fi
  27.  
  28. #is it upgrade or overlay?
  29. #   ${SCRIPTS}/chkpkgrel returns
  30. #                    1 if installed pkg if UNK version
  31. #                    2 if installed pkg is SVR4.2
  32. #                    4 if installed pkg is SVR4.0 V4
  33. #                    6 if installed pkg is 2.0x (sbird)
  34. #                    9 if installed pkg is newer
  35. #                    0 if pkg is not installed
  36.  
  37. $SCRIPTS/chkpkgrel
  38. case $? in
  39.     0)  PKGINSTALL_TYPE=NEWINSTALL
  40.         AUTOMERGE=No
  41.         ;;
  42.     2)  PKGINSTALL_TYPE=OVERLAY
  43.         AUTOMERGE=Yes
  44.         ;;
  45.     4)  PKGINSTALL_TYPE=UPGRADE
  46.         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`
  47.         exit 3
  48.         ;;
  49.     6)  PKGINSTALL_TYPE=UPGRADE2
  50.         AUTOMERGE=Yes
  51.         ;;
  52.     9)  # Newer just do overlay
  53.         PKGINSTALL_TYPE=OVERLAY
  54.         AUTOMERGE=Yes
  55.         ;;
  56.     *)  # Don't allow install
  57.         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`
  58.             exit 3
  59.         ;;
  60. esac
  61.  
  62.  
  63. echo AUTOMERGE=\"${AUTOMERGE}\" >> ${OUTPUT}
  64. echo PKGINSTALL_TYPE=\"${PKGINSTALL_TYPE}\" >> ${OUTPUT}
  65.  
  66. exit 0
  67.