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 >
Wrap
Text File
|
1995-02-07
|
5KB
|
129 lines
#!/bin/csh -f
#
# Upgrader post-processing script.
set path = (/bin /usr/bin /etc /usr/etc /usr/ucb)
unalias *
if ($#argv != 2) then
echo "Usage: PostProcess targroot sourceroot"
exit 1
endif
set target = $argv[1]
set source = $argv[2]
echo Postprocessing $target for upgrade beginning at `date` ...
foreach language (French German Italian Swedish Spanish English Japanese)
/bin/rm -rf ${target}/NextLibrary/Receipts/${language}.pkg
end
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)
echo "Removing old package receipts..."
foreach i ( ${OBSOLETE_PACKAGES} )
rm -rf ${target}/NextLibrary/Receipts/${i}.pkg
end
if (-d ${target}/usr/Devices/System.config) then
echo "Moving old drivers..."
mkdirs ${target}/UpdatedFiles/usr
if (-d ${target}/private/tmp/oldDrivers) then
set oldDrivers=${target}/private/tmp/oldDrivers
else
set oldDrivers=${target}/usr/Devices
endif
mv ${oldDrivers} ${target}/UpdatedFiles/usr/Devices
echo "Installing drivers..."
set arch=`/usr/bin/arch`
mkdirs ${target}/private/Drivers
ln -s Drivers/${arch} ${target}/private/Devices
ln -s ../private/Devices ${target}/usr/Devices
# copy non-standard drivers
cd ${target}/UpdatedFiles
ls -d -1 ./usr/Devices/*.config | sort > ${target}/private/tmp/Driver$$
foreach i (`comm -23 ${target}/private/tmp/Driver$$ ${target}/private/tmp/DriverList`)
if ( ! -d ${target}/${i} ) then
cp -r $i ${target}/usr/Devices
endif
end
rm -f ${target}/private/tmp/Driver$$ ${target}/private/tmp/DriverList
# ensure that System.config and Default.table exist
if (! -d ${target}/private/Drivers/${arch}/System.config) then
mkdirs ${target}/private/Drivers/${arch}/System.config
endif
rm -f ${target}/private/Drivers/${arch}/System.config/Default.table
cp ${source}/private/Drivers/${arch}/System.config/Default.table ${target}/private/Drivers/${arch}/System.config
echo "Upgrading drivers..."
${source}/Upgrader.app/DriverUpgrade ${target}/UpdatedFiles/usr/Devices ${target}/usr/Devices
foreach i ( ${target}/UpdatedFiles/usr/Devices/*.config )
mv ${i} ${i}_Old
end
set oldcustom=${target}/UpdatedFiles/usr/Devices/System.config/CDIS.custom
set newcustom=${target}/private/adm/CDIS.custom
if (-f ${oldcustom}) then
if (! -f ${newcustom}) then
cp ${oldcustom} ${newcustom}
endif
/bin/rm -f ${oldcustom}
endif
if (-f ${newcustom}) then
set LANGUAGE = `awk -F'=' '/LANGUAGE/ {print $2}' ${newcustom}`
grep "Language" ${target}/usr/Devices/System.config/Default.table >> /dev/null
if ($status != 0 && "${LANGUAGE}" != "") then
echo '"Language" = "'${LANGUAGE}'";' >> ${target}/usr/Devices/System.config/Default.table
endif
endif
echo "Driver upgrade complete."
endif
# Delete empty nib, if it exists.
rm -rf /usr/lib/NextStep/loginwindow.app/English.lproj/login.nib
# Do Kanji processing, if necessary.
if (-f ${source}/NextLibrary/Fonts/Kanji/.fpexData) then
/bin/cp ${source}/NextLibrary/Fonts/Kanji/.fpexData ${target}/NextLibrary/Fonts/Kanji
if (-f ${source}/NextLibrary/Fonts/Kanji/FS/FSInit) then
/bin/cp ${source}/NextLibrary/Fonts/Kanji/FS/FSInit ${target}/NextLibrary/Fonts/Kanji/FS/FSInit
endif
/usr/bin/dwrite GLOBAL NXSystemFonts "GothicBBBHelvetica;Helvetica"
/usr/bin/dwrite GLOBAL NXBoldSystemFonts "GothicBBBHelvetica-Bold;Helvetica-Bold"
endif
# copy thinned boms
set nonomatch = 1
cd ${target}/NextLibrary/Receipts
set packages = ( *.pkg )
foreach package ( ${packages} )
cd ${target}/NextLibrary/Receipts
if ( -d ${package} ) then
cd ${package}
set bom = *.bom
set newbom = ${target}/UpdatedBoms/${bom}
if ( -f ${newbom} ) then
echo Upgrading ${package} bom
/bin/cp ${newbom} ${target}/NextLibrary/Receipts/${package}
endif
endif
end
/bin/cp ${target}/UpdatedBoms/BaseSystem.bom ${target}/usr/lib/NextStep
/usr/bin/touch ${target}/private/adm/BuildDisk.custom
# execute local postprocessing script
set localscript = ${source}/usr/local/Upgrade/PostProcess
if ( -x ${localscript} ) then
${localscript} ${target} ${source} || exit 1
endif
echo Postprocessing completed at `date`.
echo Upgrade completed.
echo ""
exit 0