# $NetBSD: DEINSTALL,v 1.1.1.1 2006/06/15 13:26:42 taca Exp $ GEEKLOG_DIR="@GEEKLOG_DIR@" GEEKLOG_EXAMPLESDIR="@GEEKLOG_EXAMPLESDIR@" GEEKLOG_PUBDIR="@GEEKLOG_PUBDIR@" GEEKLOG_TMPL_SUB="@GEEKLOG_TMPL_SUB@" GEEKLOG_TMPL_DIR="@GEEKLOG_TMPL_DIR@" case ${STAGE} in DEINSTALL) cd ${GEEKLOG_TMPL_DIR} ${FIND} ${GEEKLOG_TMPL_SUB} -type f -print | \ while read f; do file="${GEEKLOG_PUBDIR}/$f" if ${TEST} -f ${file} -a -f ${f} && \ ${CMP} -s ${file} ${f}; then ${RM} -f ${file} fi done cd ${GEEKLOG_PUBDIR} ${FIND} -d ${GEEKLOG_TMPL_SUB} -type d -print | while read d; do ${RMDIR} ${d} 2>/dev/null done # XXX: work around for remaining config.php conf="${GEEKLOG_DIR}/config.php" example="${GEEKLOG_EXAMPLESDIR}/config.php" if ${TEST} -f ${conf} -a -f ${example} && ${CMP} -s ${conf} ${example}; then ${RM} ${conf} else ${ECHO} "===========================================================================" ${ECHO} "The following files are no longer being used by ${PKGNAME}," ${ECHO} "and they can be removed if no other packages are using them:" ${ECHO} "" ${ECHO} " ${conf}" ${ECHO} "" ${ECHO} "===========================================================================" fi ;; POST-DEINSTALL) ${RMDIR} -p ${GEEKLOG_DIR} 2>/dev/null if ${TEST} -d ${GEEKLOG_DIR}; then ${ECHO} "===========================================================================" ${ECHO} "The following directories are no longer being used by ${PKGNAME}," ${ECHO} "and they can be removed if no other packages are using them:" ${ECHO} "" ${ECHO} " ${GEEKLOG_DIR}" ${ECHO} "" ${ECHO} "===========================================================================" fi ;; esac