summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2003-08-27 01:59:45 +0000
committerjlam <jlam>2003-08-27 01:59:45 +0000
commitc55cd0e4a43d287ebe3465044c5d502231a2c8c0 (patch)
tree8ce4aa692575a3ac0470653ab5354a19e8177391
parentdf4bf81465cefe15cdd12450101c28d5f6dd7e67 (diff)
downloadpkgsrc-c55cd0e4a43d287ebe3465044c5d502231a2c8c0.tar.gz
Add a new su-able target "remove-views" that removes a package from the
views listed in ${PKGVIEWS}.
-rw-r--r--mk/bsd.pkg.mk31
1 files changed, 30 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 4eb308bb821..b069ca39af4 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1216.2.38 2003/08/27 01:47:32 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1216.2.39 2003/08/27 01:59:45 jlam Exp $
#
# This file is in the public domain.
#
@@ -4649,6 +4649,35 @@ real-su-build-views:
. endif
.endif
+.PHONY: remove-views
+remove-views: do-su-remove-views
+
+.PHONY: do-su-remove-views
+do-su-remove-views:
+ @${ECHO_MSG} "${_PKGSRC_IN}> Removing ${PKGNAME} from views"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ realtarget="real-su-remove-views"; \
+ action="remove-views"; \
+ ${_SU_TARGET}
+
+.PHONY: real-su-remove-views
+.if !target(real-su-remove-views)
+real-su-remove-views:
+. if (${PKG_INSTALLATION_TYPE} == "pkgviews") && defined(PKGVIEWS)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ for v in ${PKGVIEWS}; do \
+ case "$$v" in \
+ "") dbdir=${PKG_DBDIR}; viewname=standard ;; \
+ *) dbdir=${LOCALBASE}/$$v/.dbdir; viewname=$$v ;; \
+ esac; \
+ ${ECHO} "=> Removing package from $$viewname view"; \
+ ${SETENV} PLIST_IGNORE_FILES="${_PLIST_IGNORE_FILES}" ${PKG_VIEW} --view=$$v delete ${PKGNAME}; \
+ done
+.else
+ ${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA}
+. endif
+.endif
+
# Depend is generally meaningless for arbitrary packages, but if someone wants
# one they can override this. This is just to catch people who've gotten into
# the habit of typing `${MAKE} depend all install' as a matter of course.