# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # CheckZones() { if [ "$ROOTDIR" = "/" -a -x /usr/bin/zonename ]; then ZONENAME=`/usr/bin/zonename` if [ ${ZONENAME} = "global" ]; then GLOBAL_ZONE=true else GLOBAL_ZONE=false fi else # Unable to determine zone GLOBAL_ZONE=true fi } CheckZones if [ "${GLOBAL_ZONE}" != "true" ]; then exit 0 fi mypatchid=119107-06 #XXXSpecial_CommandsXXX# basedir_list_file=$ROOTDIR/var/run/$mypatchid.basedir_list ######################################################### # smpatch will be moved from SUNWswmt to another package. # Save it so we can undo on backout. ######################################################### smpatch_pkg=`grep "smpatch f" /var/sadm/install/contents | awk '{print $10}'` if [ "$smpatch_pkg" == "SUNWswmt" ]; then cp -p $ROOTDIR/usr/sbin/smpatch $ROOTDIR/var/run/$mypatchid.smpatch.SUNWswmt.undo # Inform the system that we're updating the database removef -R $ROOTDIR SUNWswmt /usr/sbin/smpatch > /dev/null 2>&1 removef -R $ROOTDIR SUNWswmt /usr/sadm/bin/smpatch > /dev/null 2>&1 # Remove the files rm $ROOTDIR/usr/sadm/bin/smpatch rm $ROOTDIR/usr/sbin/smpatch # Update the database removef -R $ROOTDIR -f SUNWswmt fi # Work around 6312956 - removef does not update zones saved # pkgmap files. Note that we use cp -p to preserve permissions # on the pkgmap file. We're cleaning up after both ourselves and # -03, which is why we do this no matter what package smpatch is # in. -03 may have successfully moved it to SUNWpprou, but # won't have cleaned up the SUNWswmt saved pkgmap. ( cd $ROOTDIR/var/sadm/pkg/SUNWswmt/save/pspool/SUNWswmt if grep "smpatch" pkgmap >/dev/null then backoutpkgmap=$ROOTDIR/var/run/$mypatchid.smpatch.SUNWswmt.undo.pkgmap cp -p pkgmap $backoutpkgmap grep "smpatch" pkgmap > $backoutpkgmap cp -p pkgmap pkgmap.tmp grep -v "smpatch" pkgmap > pkgmap.tmp mv pkgmap.tmp pkgmap fi ) ######################################################### # Change the BASEDIR for SUNWbreg and SUNWdc ######################################################### for pkg in SUNWbreg SUNWdc; do pkginfo_filename=$ROOTDIR/var/sadm/pkg/$pkg/pkginfo if [ ! -f $pkginfo_filename ]; then continue fi egrep 'BASEDIR *= */opt' $pkginfo_filename > /dev/null 2>&1 if [ $? -eq 0 ]; then cp -p $pkginfo_filename ${pkginfo_filename}.new sed 's/BASEDIR=.*/BASEDIR=\//' $pkginfo_filename > ${pkginfo_filename}.new if [ $? -eq 0 ]; then mv ${pkginfo_filename}.new $pkginfo_filename touch $basedir_list_file echo $pkg >> $basedir_list_file else rm -f ${pkginfo_filename}.new fi fi done exit 0