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

  1. #ident    "@(#)pkg4.i386:i386/pkg/uedebug/request    1.1.1.12"
  2.  
  3. FAILURE=1
  4.  
  5. trap 2 3 15
  6.  
  7. #
  8. #  Make sure LANG environment variable is set.  If it's not set
  9. #  coming in to this request script, then default to the C-locale.
  10. #
  11. [ ${LANG} ] || LANG="C"
  12. export LANG
  13.  
  14. MENU_RESP=$1
  15. RERROR=0
  16. # determine CLASSES to install
  17. urel=`uname -r`
  18. if [ $urel = "5" ]
  19. then
  20.     # native Gemini
  21.     CLASSES="bnative bnat_uw2"
  22. elif [ $urel = "4.2MP" ]
  23. then
  24.     # UnixWare - pre-Gemini
  25.     uvers=`uname -v`
  26.     vers20=`expr "$uvers" : '2\.0'`
  27.     if [ $vers20 != "0" -o $uvers = "2.1" -o $uvers = "2.1.1" ]
  28.     then
  29.         RERROR=2.1.2
  30.     else
  31.         CLASSES="uw2 bnat_uw2"
  32.     fi
  33. elif [ $urel = "3.2" ]
  34. then
  35.     # OSR5
  36.     xuname=`uname -X`
  37.     vers500=`expr "$xuname" : '.*3\.2v5\.0\.0.*'`
  38.     vers502=`expr "$xuname" : '.*3\.2v5\.0\.2.*'`
  39.     if [ $vers500 != "0" -o $vers502 != "0" ]
  40.     then
  41.         echo "Installation requires OpenServer version 5.0.4 or higher"
  42.         exit $FAILURE
  43.     else
  44.         CLASSES="osr5"
  45.     fi
  46. else
  47.     RERROR=badrel
  48. fi
  49. #
  50. # if nothing to install, exit w/ code 77 for pkging tools to exit gracefully.
  51. #
  52. if [ $RERROR != "0" ]
  53. then
  54.     #Set up localized messaging
  55.     PKGMSG=${PKGINST}.pkg
  56.     LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
  57.  
  58.     if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]
  59.     then 
  60.         if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \
  61.             -d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]
  62.         then
  63.             cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \
  64.             /usr/lib/locale/${LOCALE}/LC_MESSAGES
  65.             
  66.             installf ${PKGINST} /usr/lib/locale/${LOCALE}/LC_MESSAGES
  67.         fi
  68.     fi
  69.     if [ $RERROR = "2.1.2" ]
  70.     then
  71.         message -d `pfmt -s error -g ${PGKMSG}:1 "Installation of the %s package requires UnixWare version 2.1.2 or higher\n" ${PKGINST} 2>&1`
  72.     else
  73.         message -d `pfmt -s error -g ${PGKMSG}:2 "The %s package can only be installed on UnixWare 7 or 2.1.2 or OpenServer release 5.0.4\n" ${PKGINST} 2>&1`
  74.     fi
  75.     exit $FAILURE
  76. fi
  77.  
  78. [ "$CLASSES" ] || exit 77
  79.  
  80. echo CLASSES=\"${CLASSES}\" >> ${MENU_RESP}
  81. exit 0
  82.