summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-03-20 16:39:03 +0000
committerrillig <rillig@pkgsrc.org>2020-03-20 16:39:03 +0000
commit72db9b0fff481fcda50e3d12cc0cda2c02835d07 (patch)
treef32671533e6075d5f850535d70dcf68f5eeb4de4 /regress
parent52aa54f18992bc0425e7a724e7d34b73ee3a726c (diff)
downloadpkgsrc-72db9b0fff481fcda50e3d12cc0cda2c02835d07.tar.gz
show-all: fix output for list variables containing dollar characters
Before, variables containing dollar characters displayed so wrong that it was hard to explain. To fix the problem, I typed almost random characters into the code until the output was exactly as expected. I still do not understand: * why the list variables need 8 dollars to survive the @x@ loop, * why the code only works if the dollars come from an external variable instead of being written inline, * why the backslash in the :C modifier needs to be doubled. Anyway, the output of "bmake show-all-extract" now contains the shell variable $${extract_file}, just as it should. The dollars are now doubled in the output and thereby match the source code from the Makefile exactly.
Diffstat (limited to 'regress')
-rw-r--r--regress/show-all/Makefile8
-rw-r--r--regress/show-all/spec14
2 files changed, 11 insertions, 11 deletions
diff --git a/regress/show-all/Makefile b/regress/show-all/Makefile
index 8c0de140348..cf595355a67 100644
--- a/regress/show-all/Makefile
+++ b/regress/show-all/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/03/20 15:45:12 rillig Exp $
+# $NetBSD: Makefile,v 1.5 2020/03/20 16:39:03 rillig Exp $
DISTNAME= show-all-1.0
CATEGORIES= regress
@@ -33,9 +33,9 @@ _PKG_VARS.regress+= * **
_SORTED_VARS.regress= *_ENV.*
_LISTED_VARS.regress= *_ARGS.*
-SHELLVAR_PLAIN= "$$var $${var} $$other"
-SHELLVAR_ENV= "$$var $${var} $$other"
-SHELLVAR_ARGS= "$$var $${var} $$other"
+SHELLVAR_PLAIN= "$$var $${var} $$other $$$$"
+SHELLVAR_ENV= "$$var $${var} $$other $$$$"
+SHELLVAR_ARGS= "$$var $${var} $$other $$$$"
_VARGROUPS+= shellvar
_PKG_VARS.shellvar= SHELLVAR_PLAIN SHELLVAR_ENV SHELLVAR_ARGS
diff --git a/regress/show-all/spec b/regress/show-all/spec
index 0c2795580ca..aae29666c6f 100644
--- a/regress/show-all/spec
+++ b/regress/show-all/spec
@@ -1,4 +1,4 @@
-# $NetBSD: spec,v 1.3 2020/03/20 15:45:12 rillig Exp $
+# $NetBSD: spec,v 1.4 2020/03/20 16:39:03 rillig Exp $
tmpdir=${TMPDIR:-/tmp}/pkgsrc-show-all
rm -rf "$tmpdir"
@@ -49,7 +49,7 @@ regress:
pkg REGRESS.undefined # undefined
pkg REGRESS.empty= # empty
pkg REGRESS.space= # ends with space
- pkg REGRESS.value= All * kinds of `strange' \escape $characters
+ pkg REGRESS.value= All * kinds of `strange' \escape $$characters
pkg *= show-all-regress
pkg **= asterisk
@@ -71,17 +71,17 @@ EOF
require_file "$tmpdir/show-all-regress.out" --equals "$tmpdir/expected"
- # TODO: What the heck is going on here?
- # The output of the ENV and ARGS cases should be the same as in PLAIN.
+ # Up to 2020-03-20, the output of the ENV and ARGS variables differed
+ # a lot from the PLAIN variable.
#
cat <<'EOF' > "$tmpdir/expected"
shellvar:
- pkg SHELLVAR_PLAIN= "$var ${var} $other"
+ pkg SHELLVAR_PLAIN= "$$var $${var} $$other $$$$"
pkg SHELLVAR_ENV= \
- ".MAKE.LEVEL.ENVar ther" \
+ "$$var $${var} $$other $$$$" \
# end of SHELLVAR_ENV (sorted)
pkg SHELLVAR_ARGS= \
- ".MAKE.LEVEL.ENVar ther" \
+ "$$var $${var} $$other $$$$" \
# end of SHELLVAR_ARGS
EOF