home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / update701 / root.18 / usr / sadm / install / scripts / i_exit / i_exit
Encoding:
Text File  |  1998-08-18  |  2.0 KB  |  47 lines

  1. #ident  "@(#)i_exit    17.7    98/08/05"
  2. #copyright    "%c%"
  3. #!/sbin/sh
  4.  
  5. #
  6. # This script is invoked by pkgadd, just before exit.
  7. # At present, all the checking it does is for update 701.
  8. #
  9. # When the update is installed, for each package updated (where the list of
  10. # packages is defined by 'CLASSES' below), a file called 'uw7u1p'
  11. # is created in the /var/sadm/pkg/${pkg} directory. The creation time of
  12. # these files will reflect the time that the update was installed. For
  13. # subsequent invocations of pkgadd, i_exit checks to see if the pkginfo
  14. # file for each package is now more recent than the corresponding uw7u1p
  15. # file. If so, the update needs to be reapplied. If a new package that the
  16. # update touches is added after the update has been installed, i_exit will
  17. # still prompt the user to reapply the update because the 'find' command
  18. # will exit with a non-zero status which will set the NEEDS_UPDATE variable.
  19.  
  20.  
  21. CLASSES="acp audit base bsdcompat cmds dele esle frle i2oOSM inet jale lp ls mpio netbios netmgt nfs nis nsnavAu nsu nuc nwsrvr nwnet osmp ppp rpc scoadmin scohelp uccs ucplus uedebug usoftint ustdcomps vxvm TEDdesk TEDljpe TEDdincl TEDles TEDlogin TEDlde TEDlfr vtclrun"
  22.  
  23. # 4/8/98 jillp
  24. # Note - crypt and nics removed from the list of classes above:
  25. # The crypt package will only be installable on top of update1 and adds
  26. # functionality. After installing crypt, the user should not see the message
  27. # to reinstall the update.
  28. # Likewise, later nics packages will be installed on top of the update,
  29. # adding new hardware drivers. These won't back rev what the update
  30. # installed so there is no need to show the message asking the user to
  31. # reapply the update.
  32.  
  33. NEEDS_UPDATE=""
  34. cd /var/sadm/pkg
  35. for pkg in ${CLASSES}
  36. do
  37.     [ -f ${pkg}/pkginfo -a \
  38.         ! -f ${pkg}/!I-Lock! -a ! -f ${pkg}/!R-Lock! ] || continue
  39.     NEEDS_UPDATE=`/usr/bin/find ${pkg}/pkginfo -newer \
  40.             ${pkg}/update701 2>/dev/null || echo true`
  41.     [ "$NEEDS_UPDATE" != "" ] && break
  42. done
  43.  
  44. [ "$NEEDS_UPDATE" = "" ] && exit 0
  45. echo "\nWARNING: UnixWare Update 7.0.1 should be reapplied\n" >&2
  46. /usr/bin/sleep 5
  47.