diff options
author | rillig <rillig@pkgsrc.org> | 2007-03-16 10:05:20 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-03-16 10:05:20 +0000 |
commit | 06d7235c766d52f72aa9bf4f91b13d2f6e89da56 (patch) | |
tree | eb93bb5865a4f88b2a37b54515ec90e08d45948c /mk | |
parent | c319d43a9ee2dd806f93b9db6f1ac2342c882925 (diff) | |
download | pkgsrc-06d7235c766d52f72aa9bf4f91b13d2f6e89da56.tar.gz |
After the quick fix from some minutes ago, here is the better solution.
Just don't evaluate variables at load-time, but at run-time.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/misc/show.mk | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/mk/misc/show.mk b/mk/misc/show.mk index 9afe9be44de..39c845cd77e 100644 --- a/mk/misc/show.mk +++ b/mk/misc/show.mk @@ -1,4 +1,4 @@ -# $NetBSD: show.mk,v 1.3 2007/03/16 09:53:37 rillig Exp $ +# $NetBSD: show.mk,v 1.4 2007/03/16 10:05:20 rillig Exp $ # # This file contains some targets that print information gathered from # variables. They do not modify any variables. @@ -79,7 +79,6 @@ _LETTER._USER_VARS= U _LETTER._PKG_VARS= P _LETTER._SYS_VARS= S -.if make(show-all) show-all: .PHONY .for g in ${_VARGROUPS:O:u} @@ -90,11 +89,19 @@ show-all-${g}: .PHONY . 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 +# Be careful not to evaluate variables too early. Some may use the :sh +# modifier, which can end up taking much time and issuing unexpected +# warnings and error messages. +# +# When finally showing the variables, it is unavoidable that those +# variables requiring ${WRKDIR} to exist will show a warning. +# + @value=${${v}:M*:Q}; \ + if [ "$$value" ]; then \ + echo " ${_LETTER.${c}} ${v} = $$value"; \ + else \ + echo " ${_LETTER.${c}} ${v} (defined, but empty)"; \ + fi . else @echo " ${_LETTER.${c}} ${v} (undefined)" . endif @@ -102,4 +109,3 @@ show-all-${g}: .PHONY . endfor @echo "" .endfor -.endif |