#ident	"@(#)postinstall	1.1	02/05/30 SMI"

# The source package contains a directory having an embedded
# pound sign.  While this character is legal in filenames,
# and pkgadd and friends don't object to it, some RE tools
# aren't too happy about it, so in this package we replace the
# pound with an underscore, and rename the directory after
# installation (and update the package database too).

warn()
{
	echo "$PKG: $*" >& 2
}

oldpath=/usr/sfw/share/src/ant/src/etc/testcases/core/include/frag_ment
newpath=/usr/sfw/share/src/ant/src/etc/testcases/core/include/'frag#ment'

for i in include.xml simple.xml relative.xml include.inc
do
	removef $PKGINST $oldpath/$i >/dev/null 2>&1
done

mv $BASEDIR/$oldpath $BASEDIR/$newpath
removef $PKGINST $oldpath >/dev/null 2>&1
removef -f $PKGINST >/dev/null 2>&1 || exit 2

for i in include.xml simple.xml relative.xml include.inc
do
	installf -c none $PKGINST $BASEDIR/$newpath/$i f 0444 root bin || \
		warn "failed to add $newpath/$i to pkg database"
done
installf -c none $PKGINST $BASEDIR/$newpath d 0755 root bin || \
	warn "failed to add $newpath to pkg database"
installf -f $PKGINST || exit 2

exit 0
