diff options
author | rillig <rillig@pkgsrc.org> | 2007-03-15 22:54:24 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-03-15 22:54:24 +0000 |
commit | 8d0152e4a5ed2d2d58621fd836fd8d61f37ad700 (patch) | |
tree | 2a6ccf38a6091b29f21c0fce92183621b136e1f9 /mk/misc | |
parent | caa3807ed8c0363bf932875ed435dafa23732fee (diff) | |
download | pkgsrc-8d0152e4a5ed2d2d58621fd836fd8d61f37ad700.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.mk | 38 |
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 |