freebsd-ports/databases/namazu2/pkg-deinstall
Akinori MUSHA 8c811743b4 Attempt to preserve lib/charset.alias and share/locale/locale.alias
before installation and restore them after deinstallation.

Submitted by:	bento
2003-01-14 11:10:07 +00:00

30 lines
411 B
Bash

#!/bin/sh
#
# $FreeBSD$
PATH=/bin:/usr/bin
files="${PKG_PREFIX}/lib/charset.alias ${PKG_PREFIX}/share/locale/locale.alias"
sfx=.namazu2.backup
case $2 in
DEINSTALL)
for f in $files; do
[ -f $f$sfx ] || continue
if [ $f -nt $f$sfx ]; then
cp -p $f $f$sfx
fi
done
;;
POST-DEINSTALL)
for f in $files; do
if [ -f $f$sfx ]; then
mv -f $f$sfx $f
fi
done
;;
esac
exit 0