#!/bin/sh
#
# 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1987
# LICENSED MATERIALS - PROPERTY OF IBM
# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
#
# $Header:apply.update.1 12.0$
# $ACIS:apply.update.1 12.0$
# $Source: /ibm/acis/usr/sys/support/lib/RCS/apply.update.1,v $

#Apply.update step 1; check for modifications to the Update process itself
# and determine which files may be overwritten by the update

: ${File?} ${Buffer?} ${LIB?}

cd /
eval $Buffer tar xfp $File ./Update.1 ./Update.2 ./Update.3

if [ -r Update.1 ]
then
	sh Update.1
	rc=$?
	case $rc in
	0)	;;
	*)	exit $rc
		;;
	esac
fi

echo -n "Scanning update for files to be replaced ..."
eval $Buffer tar tf $File | grep -v '^\./Update\.[123]' > Update.list
echo " done"

echo -n "Checking new files against your system ..."
while read i
do
	if test -f $i
	then
		if find $i -newer /sys/support/.Builddate -type f -print
		then
			:
		else
			echo $0: find failed on $i >&2
		fi
	fi
done < Update.list > Tar.list
echo " done"

if [ -s Tar.list ]
then
	echo "
The file /Tar.list contains a list of"`wc -l < /Tar.list`" files that have
been modified since the system was installed and that will
be replaced by this update.  You may want to save these
files so that your modified versions may be restored after
the update.  Step 2 of apply.update will help you save these
files to a blank streaming tape that you must provide.

Press Enter when you are ready to display the file /Tar.list."
	read junk
	more /Tar.list
else
	echo "This update will not replace any files you have
modified; please continue with Step 2."
fi
exit 0
