diff options
-rw-r--r-- | databases/shared-mime-info/DEINSTALL | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/databases/shared-mime-info/DEINSTALL b/databases/shared-mime-info/DEINSTALL index 993dd373c04..933ebe69e52 100644 --- a/databases/shared-mime-info/DEINSTALL +++ b/databases/shared-mime-info/DEINSTALL @@ -1,4 +1,4 @@ -# $NetBSD: DEINSTALL,v 1.3 2008/10/31 14:02:18 wiz Exp $ +# $NetBSD: DEINSTALL,v 1.4 2011/10/29 13:20:54 marino Exp $ MIMEDB_PATH="@MIMEDB_PATH@" @@ -6,7 +6,15 @@ case ${STAGE} in POST-DEINSTALL) (cd ${MIMEDB_PATH} && \ ${LS} . | ${GREP} -v '^packages$' | ${XARGS} ${RM} -rf) - ${RMDIR} ${MIMEDB_PATH}/packages || ${TRUE} - ${RMDIR} ${MIMEDB_PATH} || ${TRUE} + if [ -d ${MIMEDB_PATH}/packages ]; then + if [ -n `${LS} -A ${MIMEDB_PATH}/packages` ]; then + ${RMDIR} ${MIMEDB_PATH}/packages + fi + fi + if [ -d ${MIMEDB_PATH} ]; then + if [ -n `${LS} -A ${MIMEDB_PATH}` ]; then + ${RMDIR} ${MIMEDB_PATH} + fi + fi ;; esac |