summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2017-06-26 20:05:35 -0600
committerAaron Ball <nullspoon@oper.io>2017-06-26 20:05:35 -0600
commit239d00878e5ec4a09518a2e39b5d81d6aaf1193e (patch)
tree1744bef07ca2192f57fa9eab47d536756c7cfa4b
parent2fa07cf2f9c960da80a946213f5970921527be83 (diff)
downloadportimg-239d00878e5ec4a09518a2e39b5d81d6aaf1193e.tar.gz
portimg-239d00878e5ec4a09518a2e39b5d81d6aaf1193e.tar.xz
libtemplate:Improved unset var warning message
Originally, the message printed just said what variable was referenced that was not set. Now it prints which template file contains the unbound variable.
-rw-r--r--lib/template.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/template.sh b/lib/template.sh
index 8cbdbfa..b8a7361 100644
--- a/lib/template.sh
+++ b/lib/template.sh
@@ -59,8 +59,9 @@ function template {
# Skip any unset but referenced variables
if [ -z "${!_varname:-}" ]; then
printf \
- "WARN: Template variable '%s' is referenced but is unset.\n" \
- ${_varname} >&2
+ "WARN: Unbound variable '%s' in template '%s'.\n" \
+ "${_varname}" \
+ "${src}" >&2
continue
fi

Generated by cgit