preinstall revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
if [ -f $BASEDIR/etc/TIMEZONE ] ; then
cp $BASEDIR/etc/TIMEZONE $BASEDIR/etc/TIMEZONE.temp
fi
if [ -h $BASEDIR/var/mail ] ; then
rm -rf $BASEDIR/var/mail.ABCsavedXYZ
mv $BASEDIR/var/mail $BASEDIR/var/mail.ABCsavedXYZ
fi
if [ -h $BASEDIR/var/news ] ; then
rm -rf $BASEDIR/var/news.ABCsavedXYZ
mv $BASEDIR/var/news $BASEDIR/var/news.ABCsavedXYZ
fi
CLEANUP=/tmp/CLEANUP
print_dhcptags_warning() {
cat >> $CLEANUP <<-EOF
You have made changes to /etc/dhcp/dhcptags, which has been superseded
by /etc/dhcp/inittab, as documented in dhcp_inittab(4). Please refer
to the DHCP documentation in the Answerbook for information on how to
convert your existing customizations.
EOF
}
if [ "x$UPDATE" = xyes ]; then
DHCPTAGS=$BASEDIR/etc/dhcp/dhcptags
# If the dhcptags file has been modified, then install moved
# it to a funky name like /etc/dhcp/dhcptags:8. Use this as
# an opportunity to issue a warning to the user. Since the
# file may be left over from a previous upgrade, only issue
# the warning if the current package database is familiar with
# the file.
#
# The construct ${PKG_INSTALL_ROOT:-/} is used instead of
# $PKG_INSTALL_ROOT/ because the packaging subsystem will
# think we're changing the path (from $PKG_INSTALL_ROOT to
# $PKG_INSTALL_ROOT/) and will output spurious warnings.
#
# We need to pass in the -R since otherwise we will get a
# warning from a `make install' on this package that we may
# be accessing a stale package database (in fact, this won't
# happen since installf and friends inherit the
# $PKG_INSTALL_ROOT environment variable). Note that the -R
# must be on the same line as the command it's used with.
#
# ${CLIENT_BASEDIR}foo is used instead of $CLIENT_BASEDIR/foo
# because the packaging commands don't always realize that
# //foo and /foo are the same file.
if [ "`echo $DHCPTAGS:*`" != "$DHCPTAGS:*" ]; then
pkgchk -l -R ${PKG_INSTALL_ROOT:-/} \
-p ${CLIENT_BASEDIR}etc/dhcp/dhcptags $PKGINST | \
grep -i installed > /dev/null 2>&1 && \
print_dhcptags_warning
fi
fi
exit 0