home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2
/
Openstep-4.2-Intel-User.iso
/
Upgrader.app
/
Default.upgrade
/
PreProcess
< prev
next >
Wrap
Text File
|
1997-03-11
|
3KB
|
84 lines
#!/bin/csh -f
#
# Upgrader pre-processing script.
set path = (/bin /usr/bin /etc /usr/etc /usr/ucb)
unalias *
if ($#argv != 2) then
echo "Usage: PreProcess targroot sourceroot"
exit 1
endif
set target = $argv[1]
set source = $argv[2]
echo Preparing $target for upgrade at `date` ...
# execute local preprocessing script
set localscript = ${source}/usr/local/Upgrade/PreProcess
if ( -x ${localscript} ) then
${localscript} ${target} ${source} || exit 1
endif
# Pre-remove compressed languages to try and free up as much space as possible.
foreach language (French German Italian Swedish Spanish English)
set statusfile = ${target}/NextLibrary/Receipts/${language}.pkg/${language}.status
if (-f $statusfile) then
if (`/bin/cat $statusfile` == "compressed") then
echo Removing files for ${language}, which was never used...
/bin/rm -rf ${target}/NextLibrary/Receipts/${language}.pkg
endif
endif
end
# Grab list of drivers supplied with the system.
/bin/rm -f ${target}/private/tmp/DriverList
${source}/usr/etc/lsbom -s ${target}/usr/lib/NextStep/BaseSystem.bom | egrep '\.config$' | sort > ${target}/private/tmp/DriverList
# Copy driver instances.
set arch=`/usr/bin/arch`
set oldDrivers=${target}/private/tmp/oldDrivers
if (-d ${target}/private/Drivers/${arch}) then
/bin/rm -rf ${oldDrivers}
/bin/mkdir ${oldDrivers}
set olddir=`/bin/pwd`
cd ${target}/private/Drivers/${arch}
/usr/bin/find . \( -name \*.table -o -name \*.strings -o -name \*.modes -o -name \*.custom \) -print | /usr/bin/cpio -pd ${oldDrivers}
cd ${olddir}
endif
# Remove boms if left over from previous upgrade attempt
/bin/rm -rf ${target}/UpdatedBoms.old
if (-d ${target}/UpdatedBoms) then
/bin/mv ${target}/UpdatedBoms ${target}/UpdatedBoms.old
endif
# Move old updated files out of the way
/bin/rm -rf ${target}/UpdatedFiles.old
if (-d ${target}/UpdatedFiles) then
/bin/mv ${target}/UpdatedFiles ${target}/UpdatedFiles.old
endif
# Copy old binaries to use in the post process
/bin/mkdirs ${target}/UpdatedFiles
/bin/cp -p /bin/rm ${target}/UpdatedFiles/rm
/bin/cp -p /bin/echo ${target}/UpdatedFiles/echo
/bin/cp -p /bin/mkdir ${target}/UpdatedFiles/mkdir
/bin/cp -p /bin/mv ${target}/UpdatedFiles/mv
/bin/cp -p /bin/ln ${target}/UpdatedFiles/ln
/bin/cp -p /bin/ls ${target}/UpdatedFiles/ls
/bin/cp -p /bin/cp ${target}/UpdatedFiles/cp
/bin/cp -p /bin/grep ${target}/UpdatedFiles/grep
/bin/cp -p /usr/bin/comm ${target}/UpdatedFiles/comm
/bin/cp -p /usr/bin/arch ${target}/UpdatedFiles/arch
/bin/cp -p /bin/awk ${target}/UpdatedFiles/awk
/bin/cp -p /usr/bin/touch ${target}/UpdatedFiles/touch
/bin/cp -p /bin/csh /tmp/csh
/bin/cp -p /usr/bin/sort ${target}/UpdatedFiles/sort
/bin/cp -p /bin/date ${target}/UpdatedFiles/date
echo Upgrade preparation completed at `date`.
echo ""
exit 0