From e46756fa3bc46fc53f0dab487cd4d3366920921e Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 27 Aug 2003 01:59:45 +0000 Subject: Add a new su-able target "remove-views" that removes a package from the views listed in ${PKGVIEWS}. --- mk/bsd.pkg.mk | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3