aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authorMatthew Seaman <matthew@FreeBSD.org>2014-05-06 04:13:39 +0800
committerMatthew Seaman <matthew@FreeBSD.org>2014-05-06 04:13:39 +0800
commitc1617bf42565a68989e579467ae7964eb9953cdd (patch)
tree6910509510ebb31fd7c2c6ade6ca53ba06af5206 /ports-mgmt
parent213ca65426d53ab4c7d0309c0d891b49a17157f5 (diff)
downloadfreebsd-ports-gnome-c1617bf42565a68989e579467ae7964eb9953cdd.tar.gz
freebsd-ports-gnome-c1617bf42565a68989e579467ae7964eb9953cdd.tar.zst
freebsd-ports-gnome-c1617bf42565a68989e579467ae7964eb9953cdd.zip
Clean up the /var/db/portindex directory (if it is empty) on
deinstallation. Submitted by: swills (via jenkins.freebsd.org)
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/Makefile5
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in23
2 files changed, 26 insertions, 2 deletions
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/Makefile b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
index 0bbc76ac26db..f5d713f64c0d 100644
--- a/ports-mgmt/p5-FreeBSD-Portindex/Makefile
+++ b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
@@ -3,6 +3,7 @@
PORTNAME= FreeBSD-Portindex
PORTVERSION= 3.4
+PORTREVISION= 1
CATEGORIES= ports-mgmt perl5
MASTER_SITES= http://www.infracaninophile.co.uk/portindex/
PKGNAMEPREFIX= p5-
@@ -37,13 +38,13 @@ CACHE_MODE?= 0775
CFG_FILE= portindex.cfg
-SUB_FILES+= pkg-install
+SUB_FILES+= pkg-install pkg-deinstall
SUB_LIST+= CACHE_DIR=${CACHE_DIR} \
CACHE_OWNER=${CACHE_OWNER} \
CACHE_GROUP=${CACHE_GROUP} \
CACHE_MODE=${CACHE_MODE}
-post-install: install-conf
+post-install: install-conf
install-conf:
cd ${WRKSRC} ; \
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in
new file mode 100644
index 000000000000..fa79034099ab
--- /dev/null
+++ b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/usr/sbin:/usr/bin:/bin ; export PATH
+
+CACHE_DIR=%%CACHE_DIR%%
+
+case $2 in
+
+ # Remove the cache directory, but only if it is empty.
+
+ POST-DEINSTALL)
+ if [ ! -d ${CACHE_DIR} ] ; then
+ rmdir ${CACHE_DIR} >/dev/null 2>&1 || true
+ fi
+ ;;
+esac
+
+#
+# That's All Folks!
+#