home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 4.0 PR1 / NeXT_NEXTSTEP_4.0_PR1_(beta).rar / Openstep4-Pr1User.iso / Upgrader.app / Default.upgrade / PostProcess < prev    next >
Text File  |  1995-02-07  |  5KB  |  129 lines

  1. #!/bin/csh -f
  2. #
  3. # Upgrader post-processing script.
  4.  
  5. set     path = (/bin /usr/bin /etc /usr/etc /usr/ucb)
  6. unalias *
  7.  
  8. if ($#argv != 2) then
  9.     echo "Usage: PostProcess targroot sourceroot"
  10.     exit 1
  11. endif
  12.  
  13. set target = $argv[1]
  14. set source = $argv[2]
  15.  
  16. echo Postprocessing $target for upgrade beginning at `date` ...
  17.  
  18. foreach language (French German Italian Swedish Spanish English Japanese)
  19.     /bin/rm -rf ${target}/NextLibrary/Receipts/${language}.pkg
  20. end
  21.     
  22. set OBSOLETE_PACKAGES = (EpsonWingineDriver SCSITapeDriver EtherExpressDriver SerialPortDriver AutoHostAddPatch ATIDriver DBKitPrerelease EuroKeymaps IntelGXAudio Interceptor S3Driver Adaptec154xDriver Adaptec6x60SCSIDriver CogentEISADriver DOSFileSysPatch DiamondStealth64DisplayDriver EtherLinkIIIDriver HPVectra_XM_XP_LANDriver HPXPDisplayDriver IntelGXAudioDriver InterBaseAdaptor NetWareKernelPatch Number9GXE64ProDisplayDriver RestorePatch SendmailPatch TokenExpressDriver WeitekP9000Driver Adaptec6x60Driver IBMTokenRingDriver IndexingKitPatch SoftPCNetWarePatch pdump)
  23.  
  24. echo "Removing old package receipts..."
  25. foreach i ( ${OBSOLETE_PACKAGES} )
  26.     rm -rf ${target}/NextLibrary/Receipts/${i}.pkg
  27. end
  28.  
  29. if (-d ${target}/usr/Devices/System.config) then
  30.       echo "Moving old drivers..."
  31.       mkdirs ${target}/UpdatedFiles/usr
  32.       if (-d ${target}/private/tmp/oldDrivers) then
  33.           set oldDrivers=${target}/private/tmp/oldDrivers
  34.       else
  35.       set oldDrivers=${target}/usr/Devices
  36.       endif
  37.       mv ${oldDrivers} ${target}/UpdatedFiles/usr/Devices
  38.       echo "Installing drivers..."
  39.       set arch=`/usr/bin/arch`
  40.       mkdirs ${target}/private/Drivers
  41.       ln -s Drivers/${arch} ${target}/private/Devices
  42.       ln -s ../private/Devices ${target}/usr/Devices
  43.       
  44.       # copy non-standard drivers
  45.       cd ${target}/UpdatedFiles
  46.       ls -d -1 ./usr/Devices/*.config | sort > ${target}/private/tmp/Driver$$
  47.       foreach i (`comm -23 ${target}/private/tmp/Driver$$ ${target}/private/tmp/DriverList`)
  48.       if ( ! -d ${target}/${i} ) then
  49.             cp -r $i ${target}/usr/Devices
  50.           endif
  51.       end
  52.       rm -f ${target}/private/tmp/Driver$$ ${target}/private/tmp/DriverList
  53.  
  54.       # ensure that System.config and Default.table exist
  55.       if (! -d ${target}/private/Drivers/${arch}/System.config) then
  56.         mkdirs ${target}/private/Drivers/${arch}/System.config
  57.       endif
  58.       rm -f ${target}/private/Drivers/${arch}/System.config/Default.table
  59.       cp ${source}/private/Drivers/${arch}/System.config/Default.table ${target}/private/Drivers/${arch}/System.config
  60.  
  61.       echo "Upgrading drivers..."
  62.       ${source}/Upgrader.app/DriverUpgrade ${target}/UpdatedFiles/usr/Devices ${target}/usr/Devices
  63.       foreach i ( ${target}/UpdatedFiles/usr/Devices/*.config )
  64.      mv ${i} ${i}_Old
  65.       end
  66.       set oldcustom=${target}/UpdatedFiles/usr/Devices/System.config/CDIS.custom
  67.       set newcustom=${target}/private/adm/CDIS.custom
  68.       if (-f ${oldcustom}) then
  69.         if (! -f ${newcustom}) then
  70.                     cp ${oldcustom} ${newcustom}
  71.                 endif
  72.                 /bin/rm -f ${oldcustom}
  73.       endif
  74.       if (-f ${newcustom}) then
  75.         set LANGUAGE = `awk -F'=' '/LANGUAGE/ {print $2}' ${newcustom}`
  76.                 
  77.         grep "Language" ${target}/usr/Devices/System.config/Default.table >> /dev/null
  78.         if ($status != 0 && "${LANGUAGE}" != "") then
  79.                     echo '"Language" = "'${LANGUAGE}'";' >> ${target}/usr/Devices/System.config/Default.table
  80.                 endif
  81.     endif
  82. echo "Driver upgrade complete."
  83. endif
  84.  
  85. # Delete empty nib, if it exists.
  86. rm -rf /usr/lib/NextStep/loginwindow.app/English.lproj/login.nib
  87.  
  88. # Do Kanji processing, if necessary.
  89. if (-f ${source}/NextLibrary/Fonts/Kanji/.fpexData) then
  90.     /bin/cp ${source}/NextLibrary/Fonts/Kanji/.fpexData ${target}/NextLibrary/Fonts/Kanji
  91.     if (-f ${source}/NextLibrary/Fonts/Kanji/FS/FSInit) then
  92.         /bin/cp ${source}/NextLibrary/Fonts/Kanji/FS/FSInit ${target}/NextLibrary/Fonts/Kanji/FS/FSInit
  93.     endif
  94.     /usr/bin/dwrite GLOBAL NXSystemFonts "GothicBBBHelvetica;Helvetica"
  95.     /usr/bin/dwrite GLOBAL NXBoldSystemFonts "GothicBBBHelvetica-Bold;Helvetica-Bold"
  96. endif
  97.  
  98. # copy thinned boms
  99. set nonomatch = 1
  100. cd ${target}/NextLibrary/Receipts
  101. set packages = ( *.pkg )
  102. foreach package ( ${packages} )
  103.     cd ${target}/NextLibrary/Receipts
  104.     if ( -d ${package} ) then
  105.         cd ${package}
  106.         set bom = *.bom
  107.         set newbom = ${target}/UpdatedBoms/${bom}
  108.         if ( -f ${newbom} ) then
  109.             echo Upgrading ${package} bom
  110.             /bin/cp ${newbom} ${target}/NextLibrary/Receipts/${package}
  111.         endif
  112.     endif
  113. end
  114. /bin/cp ${target}/UpdatedBoms/BaseSystem.bom ${target}/usr/lib/NextStep
  115. /usr/bin/touch ${target}/private/adm/BuildDisk.custom
  116.  
  117.  
  118. # execute local postprocessing script
  119. set localscript = ${source}/usr/local/Upgrade/PostProcess
  120. if ( -x ${localscript} ) then
  121.     ${localscript} ${target} ${source} || exit 1
  122. endif
  123.  
  124. echo Postprocessing completed at `date`.
  125. echo Upgrade completed. 
  126. echo ""
  127.  
  128. exit 0
  129.