|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T U
Length: 4043 (0xfcb)
Types: TextFile
Notes: UNIX file
Names: »UNINSTALL«
└─⟦0f0f313e4⟧ Bits:30004764 SW95709I.2F TCP/IP Update 1
└─⟦0f0f313e4⟧ UNIX Filesystem
└─⟦this⟧ »install/UNINSTALL«
# (c) Copyright 1990 INTERACTIVE Systems Corporation
# All rights reserved.
#
# RESTRICTED RIGHTS
#
# These programs are supplied under a license. They may be used,
# disclosed, and/or copied only as permitted under such license
# agreement. Any copy must contain the above copyright notice and
# this restricted rights notice. Use, copying, and/or disclosure
# of the programs is strictly prohibited unless otherwise provided
# in the license agreement.
#
# @(#)UNINSTALL 2.5 - 90/06/07
getmulti() { # sets $pkgs string to what user wants to remove
ALLPKGS=$pkgs
SCREEN=/tmp/SCREEN$$
nbrpkgs=$1
echo "This Package Contains the following: \n" > $SCREEN
npkg=0
for pkg in $ALLPKGS
do
getpkgname
npkg=`expr $npkg + 1`
echo " ${npkg}. ${PKGNAME:-$pkg}" >> $SCREEN
done
[ -x /usr/bin/tput ] && tput clear
cat $SCREEN
rm -f $SCREEN
echo "\nEnter a list of numbers separated by spaces for those modules"
echo "you wish to remove, or enter <RETURN> to remove all modules: \c"
read zz
if [ "$zz" = "all" -o "$zz" = "" ]; then return 0; fi
echo
pkgs=
set $zz
while [ -n "$1" ]
do
if [ "$1" -ge "1" -a "$1" -le "$nbrpkgs" ]
then
npkg=1
for pkg in $ALLPKGS
do
if [ "$npkg" = "$1" ]
then
pkgs="$pkgs $pkg"
break
fi
npkg=`expr $npkg + 1`
done
fi
shift
done
}
getmntdev() { # find mount device
for MNTDEV in $1 /dev/diskette /dev/install
do
[ -b $MNTDEV ] && return 0
done
echo "**ERROR** Can't find mount device"
exit 1
}
yesorno() { # return 0 for yes, 1 for no
QUESTION="$*"
while :
do
echo "$QUESTION (y/n)? \c"
read ans
case "$ans" in
y*|Y*) return 0 ;;
n*|N*) return 1 ;;
*) echo '\nPlease answer "y" or "n".\n'
;;
esac
done
}
# START HERE: $0 called with $1 and $2
getmntdev $1
export MNTDEV
INSPATH=${2:-/install}; export INSPATH
INSDIR=/usr/lib/installed
CONF=${CONF:-/etc/conf}
SCRIPTS=/tmp/instpkg$$
[ -d ${INSDIR} ] || mkdir ${INSDIR} && chmod 755 ${INSDIR}
[ -d ${INSDIR}/Files ] || mkdir ${INSDIR}/Files && chmod 755 ${INSDIR}/Files
[ -d ${INSDIR}/Remove ] || mkdir ${INSDIR}/Remove && chmod 755 ${INSDIR}/Remove
# setup list of packages (default, only one)
cd $INSPATH
# Get the packages on this diskette
pkgs=`echo * | sed 's/install//'`
set $pkgs
nbr=$#
[ $nbr -gt 1 ] && getmulti $nbr
cd /
for pkg in $pkgs
do
PKGNAME=`cut -f1 -d'-' $INSPATH/$pkg/install/$pkg.name`
FREL=`cut -f2 -d'-' $INSPATH/$pkg/install/$pkg.name`
if [ -s /usr/options/$pkg.name ]
then
HREL=`cut -f2 -d'-' /usr/options/$pkg.name`
else
HREL=$FREL
fi
if [ "$FREL" != "$HREL" ]
then
echo "\nThe Version of $PKGNAME on the hard disk"
echo "is $HREL, which is different than the"
echo "Version on this floppy ($FREL)"
echo "The wrong files may be removed."
yesorno "Do you want to remove $PKGNAME" || continue
fi
if [ -f $INSPATH/$pkg/install/drivers ]
then
echo "The following driver(s) is being removed:"
cat $INSPATH/$pkg/install/drivers | while read dname
do
echo "\t$dname"
${CONF}/bin/idcheck -p $dname >/dev/null 2>&1
if [ $? != 0 ]
then
if [ -f ${CONF}/pack.d/$dname/stubs.c ]
then
${CONF}/bin/idinstall -gs $dname | \
sed -e 's/Y/N/' >System
${CONF}/bin/idinstall -eus $dname
${CONF}/bin/idinstall -dopnirhclz $dname >/dev/null 2>&1
else
${CONF}/bin/idinstall -d $dname >/dev/null 2>&1
fi
if [ $? != 0 ]
then
echo $ERROR
exit 1
fi
fi
done
fi
#
# Remove linked files and invoke unsetup file
#
[ -f $INSPATH/$pkg/install/unlink ] && /bin/sh $INSPATH/$pkg/install/unlink
[ -f $INSPATH/$pkg/install/unsetup ] && /bin/sh $INSPATH/$pkg/install/unsetup
#
# Remove the files found in the Rlist file from the hard disk.
#
echo "The following files are being removed:"
for i in `cat $INSPATH/$pkg/install/Rlist.$pkg`
do
echo $i
rm -fr $i
done
#
# Invoke postuninstall file
#
[ -f $INSPATH/$pkg/install/puninstall ] && /bin/sh $INSPATH/$pkg/install/puninstall
echo "The ${PKGNAME} has been removed."
done