#!/bin/sh ## # Once off change for u4 FKU SUNWcsr. Needed to work around a deficiency in pkg ## # level script templates causing them not to populate prototype file for undo pkg ## # correctly across object type/class changes. ## # ## # See full comments in checkinstall. PATCH=/usr/bin/patch SED="/usr/bin/sed" CP="/usr/bin/cp" MV="/usr/bin/mv" OLD_PATCH_SEPARATOR="___Old_File_Diff_Separator_aBcDeFgHiJkLmN___OjK___5924894_6548915___" PATCH_SAVE_SUFFIX="pre${ACTIVE_PATCH}" get_orig() { cat $1 | \ $SED -ne "1,/${OLD_PATCH_SEPARATOR}/{/${OLD_PATCH_SEPARATOR}/d;p;}" } get_diff() { cat $1 | \ $SED -ne "/${OLD_PATCH_SEPARATOR}/,\${/${OLD_PATCH_SEPARATOR}/d;p;}" } [ "$BASEDIR" = "/" ] || BASEDIR=$BASEDIR/ while read src dst ; do # File etc/inet/ipnodes was replaced by a symlink on patch installation. # Restore the original etc/inet/ipnodes file on backout. The cp/mv combination # achieves replacement of the symlink, instead of clobbering the symlink target. # All other files of class preserve are a noop. if [ "`echo $dst | $SED \"s|^$BASEDIR||\"`" = "etc/inet/ipnodes" ] ; then $CP -p $src $dst.$$135642 $MV -f $dst.$$135642 $dst continue fi realdst="`echo $dst| /bin/sed -e 's/\.old_and_patch$//'`" if [ "$realdst" != "$dst" ]; then cp "${src}" "${dst}" if [ -f "${realdst}" ] ; then get_diff $src | $PATCH -o /dev/null -R $realdst >/dev/null 2>&1 if [ "$?" = "0" ] ; then get_diff $src | $PATCH -R $realdst >/dev/null 2>&1 else get_orig $src > "$realdst.${PATCH_SAVE_SUFFIX}" if [ -f "${realdst}.rej" ] ; then rm -f "${realdst}.rej" fi fi else get_orig $src > $realdst fi fi done ## # Fix section end. exit 0