diff options
author | jlam <jlam@pkgsrc.org> | 2003-08-27 01:59:45 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-08-27 01:59:45 +0000 |
commit | e46756fa3bc46fc53f0dab487cd4d3366920921e (patch) | |
tree | 8ce4aa692575a3ac0470653ab5354a19e8177391 | |
parent | 4b7dce019d3f360af678c0ff25250f4ce348abc2 (diff) | |
download | pkgsrc-e46756fa3bc46fc53f0dab487cd4d3366920921e.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.mk | 31 |
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. |