summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authormarino <marino@pkgsrc.org>2011-10-29 13:20:54 +0000
committermarino <marino@pkgsrc.org>2011-10-29 13:20:54 +0000
commit9717cd646a0a981a4ecb83e3115d948c17eef277 (patch)
tree19de5768160e945424b186753fe52863167e9054 /databases
parent3f16d1ed56529c372fad79a18cb1a357a5c9894b (diff)
downloadpkgsrc-9717cd646a0a981a4ecb83e3115d948c17eef277.tar.gz
databases/share-mime-info: Improve DEINSTALL script
Fixes the following issue: > pkg_delete shared-mime-info-0.90nb1 rmdir: /usr/pkg/share/mime/packages: No such file or directory
Diffstat (limited to 'databases')
-rw-r--r--databases/shared-mime-info/DEINSTALL14
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