summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2004-03-26 02:38:42 +0000
committerwiz <wiz@pkgsrc.org>2004-03-26 02:38:42 +0000
commit8cc000c162f00aedfe793c529f53bbc1eace3518 (patch)
tree9d044282b4c189729c26b7eff34c27b4b96f0176 /Makefile
parent559603c1ddc7d4f664173836c7bd4b515a5539f1 (diff)
downloadpkgsrc-8cc000c162f00aedfe793c529f53bbc1eace3518.tar.gz
Add show-deps target:
List all packages that depend on a particular package; needs the INDEX file Usage: 'make show-deps PKG=openssl' PKG: name of the package No make dependency on INDEX by purpose, since INDEX generation right now happens too often (too much phoniness, I guess).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0a6b5967fa4..a895976610c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.63 2004/02/28 06:04:13 grant Exp $
+# $NetBSD: Makefile,v 1.64 2004/03/26 02:38:42 wiz Exp $
#
.include "mk/bsd.prefs.mk"
@@ -235,3 +235,11 @@ show-host-specific-pkgs:
@${ECHO} "HOST_SPECIFIC_PKGS= \\"; \
${MAKE} show-pkgsrc-dir | ${AWK} '/^===/ { next; } { printf("%s \\\n", $$1) }'; \
${ECHO} ""
+
+# list all packages that depend on a particular package; needs the INDEX file
+# usage: 'make show-deps PKG=openssl'
+# PKG: name of the package
+show-deps:
+ @if [ ! -f "${.CURDIR}/INDEX" ]; then ${ECHO} "No index available -- please build it with 'make index'" >&2; ${FALSE}; fi
+ @if [ -z "${PKG}" ]; then ${ECHO} "PKG variable not set" >&2; ${FALSE}; fi
+ @${GREP} -E "^([^|]*\|){7}([^|]* |)${PKG}>=" ${.CURDIR}/INDEX | ${SED} -n "s/^[^|]*|\([^|]*\)|.*/\1/p" | ${SORT}