summaryrefslogtreecommitdiff
path: root/mk/misc
diff options
context:
space:
mode:
authorrillig <rillig>2007-03-15 22:54:24 +0000
committerrillig <rillig>2007-03-15 22:54:24 +0000
commitefcaabd81b47e2a80d71e51f546db00372c12d66 (patch)
tree2a6ccf38a6091b29f21c0fce92183621b136e1f9 /mk/misc
parent5c0c8af41749b510aa8eab73465be92a679845e6 (diff)
downloadpkgsrc-efcaabd81b47e2a80d71e51f546db00372c12d66.tar.gz
For all those who are interested in the inner workings of pkgsrc, there
is a new target "show-all" that fits to the existing "debug", "show-tools", "show-vars" targets. It prints a list of the variables that make up the public interface to pkgsrc. Running this target is especially useful if you want to do some things, you know that they must have been implemented but you don't know what it is called. It also shows the "class" of a variable (user-defined, package-defined, system-defined).
Diffstat (limited to 'mk/misc')
-rw-r--r--mk/misc/show.mk38
1 files changed, 37 insertions, 1 deletions
diff --git a/mk/misc/show.mk b/mk/misc/show.mk
index cbe21c0ea07..5ce24c8fb2f 100644
--- a/mk/misc/show.mk
+++ b/mk/misc/show.mk
@@ -1,4 +1,4 @@
-# $NetBSD: show.mk,v 1.1 2007/01/02 21:29:07 rillig Exp $
+# $NetBSD: show.mk,v 1.2 2007/03/15 22:54:24 rillig Exp $
#
# This file contains some targets that print information gathered from
# variables. They do not modify any variables.
@@ -65,3 +65,39 @@ show-build-defs: .PHONY
# @deprecated -- remove after 2007Q1
build-defs-message: show-build-defs .PHONY
+
+# show-all:
+# Prints a list of (hopefully) all pkgsrc variables that are visible
+# to the user or the package developer. It is intended to give
+# interested parties a better insight into the inner workings of
+# pkgsrc.
+#
+# Keywords: debug show
+#
+
+_LETTER._USER_VARS= U
+_LETTER._PKG_VARS= P
+_LETTER._SYS_VARS= S
+
+show-all: .PHONY
+.for g in ${_VARGROUPS:O:u}
+
+show-all: show-all-${g}
+
+show-all-${g}: .PHONY
+ @echo "${g}:"
+. for c in _USER_VARS _PKG_VARS _SYS_VARS
+. for v in ${${c}.${g}}
+. if defined(${v})
+. if empty(${v}:M*)
+ @echo " ${_LETTER.${c}} ${v} (defined, but empty)"
+. else
+ @echo " ${_LETTER.${c}} ${v} = "${${v}:Q}
+. endif
+. else
+ @echo " ${_LETTER.${c}} ${v} (undefined)"
+. endif
+. endfor
+. endfor
+ @echo ""
+.endfor