#!/bin/sh # # $FreeBSD: /tmp/pcvs/ports/www/twiki/files/pkg-deinstall.in,v 1.1 2008-04-22 08:36:40 sat Exp $ # TWDIR=%%TWDIR%% WWWDIR=%%WWWDIR%% case $2 in DEINSTALL) cd ${TWDIR}/ find -s * -not -type d | while read file; do if [ -e ${WWWDIR}/$file ]; then if cmp -s ${WWWDIR}/$file $file; then rm -f ${WWWDIR}/$file else echo "${WWWDIR}/$file changed, skipping" fi else echo "${WWWDIR}/$file lost" fi done find -ds * -type d | while read dir; do rmdir ${WWWDIR}/$dir/ 2>/dev/null || true done rmdir ${WWWDIR}/ 2>/dev/null || true ;; POST-DEINSTALL) ;; *) echo "Unexpected Argument $2!" exit 1 ;; esac exit 0