154N/A# The contents of this file are subject to the terms of the
154N/A# Common Development and Distribution License (the "License").
154N/A# You may not use this file except in compliance with the License.
154N/A# See the License for the specific language governing permissions
154N/A# and limitations under the License.
154N/A# When distributing Covered Code, include this CDDL HEADER in each
154N/A# If applicable, add the following below this CDDL HEADER, with the
154N/A# fields enclosed by brackets "[]" replaced with your own identifying
154N/A# information: Portions Copyright [yyyy] [name of copyright owner]
154N/A#ident "%Z%%M% %I% %E% SMI"
154N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
154N/A# Use is subject to license terms.
61N/ALINKERALIAS=linker_install@eng.sun.com
61N/A# This script handles the installation of the new sgstools on
61N/A# both Solaris10 systems (which libraries moved to '/lib') and
61N/A# pre Solaris10 systems where libraries reside under '
/usr/lib'.
61N/A# We test to deterine if '/lib' is a symlink (pre Solaris10) or a
289N/A# directory (Solaris10 & later). We key off of that for
289N/A # Build '/lib' file list for backing up
155N/A find . \( -type f -o -type l \) -print | while read file
61N/A if [ \( -f $BASEDIR/$LIBBASE/$file \) -o \
62N/A \( -h $BASEDIR/$LIBBASE/$file \) ]; then
62N/A echo $LIBBASE/$file
62N/A # Build rest of files
62N/A cd $BASEDIR/$SGSDIR
155N/A find usr \( -type f -o -type l \) -print | while read file
62N/A if [ \( -f $BASEDIR/$file \) -o \
62N/A \( -h $BASEDIR/$file \) ]; then
62N/A rm -f ${SGSBACKUPDIR}.newfiles
62N/A # add to the system that do not already exist.
289N/A find . -depth -print | while read file
289N/A echo $LIBBASE/$file >> ${SGSBACKUPDIR}.newfiles
62N/A find usr -depth -print | while read file
62N/A if [ $? = 0 ]; then
62N/A echo $file >> ${SGSBACKUPDIR}.newfiles
62N/A# Generate a file containing the names of the files and directories
155N/A# that are being added (as opposed to being replaced) to the system.
62N/A# These items will need to be explicitly removed at uninstall.
62N/A# backup all existing SGStools.
62N/ALIBLIST=`build_liblist`
62N/AFILELIST=`build_filelist`
62N/Aecho "Backup up existing SGS tools to $SGSBACKUPDIR..."
62N/Afor file in $LIBLIST $FILELIST $ETCLIST
62N/Adone | cpio -pdm $BASEDIR/$SGSBACKUPDIR
62N/A# Overwrite SGSTOOLS onto existing system. We use CPIO
155N/A# because rm's a file and then installs a new one
62N/A# instead of copying over a existing file. This is
62N/A# required when updating libraries (and the run-time linker)
62N/A# which are currently being used.
61N/A# First '/lib' components
1173N/Aecho "Installing new SGSTOOLS from $BASEDIR/$SGSDIR"
154N/Afind . -depth -print | cpio -o -O $ONLDCPIO
61N/Afind usr -depth -print | cpio -o -O $ONLDCPIO
61N/Acpio -imdu < $ONLDCPIO
61N/Aif [ "${ETCLIST}x" != "x" ]; then
61N/ALD_BIND_NOW=$prev_bindnow
61N/A#### E-mail sent to track installations of SUNWonld package.
61N/A#### purely for statistical purposes.
533N/A###Subject: SUNWonld Linker Package Installation: $PRODVERS
61N/A###Package Installation
61N/A###VERSION: $VERSION