#!/bin/sh # # Copyright 2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # error=no while read dest do if [ -d $dest ] then echo "$dest" rmdir $dest || error=yes elif [ -f $dest ] then echo "Modifying $dest" # Strip PKG_INSTALL_ROOT from dest if installation is to an # alternate root. if [ -n "$PKG_INSTALL_ROOT" -a "$PKG_INSTALL_ROOT" != "/" ]; then client_dest=`echo $dest | \ /usr/bin/nawk -v rootdir="$PKG_INSTALL_ROOT" '{ { print substr($0, length(rootdir)+1)} }'` savepath=$PKGSAV/build${client_dest} else savepath=$PKGSAV/build${dest} fi chmod +x $savepath if $savepath remove > /tmp/$$build then if [ ! -s /tmp/$$build ] then rm -f $dest else cp /tmp/$$build $dest || error=yes fi else error=yes fi rm -f /tmp/$$build else [ -r $dest ] && echo "$dest" rm -f $dest || error=yes fi done [ "$error" = yes ] && exit 2 exit 0