summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-05-15 22:50:13 +0000
committerrillig <rillig@pkgsrc.org>2005-05-15 22:50:13 +0000
commitf58a634f12f4103724a307c1808abf7c208f58dc (patch)
tree4dbacdb8cf75bb782c8002a603f445712fe418e1 /regress
parent2205e39726505c9e70263fed52e9bd57a644e62b (diff)
downloadpkgsrc-f58a634f12f4103724a307c1808abf7c208f58dc.tar.gz
Found a bug in the pkgsrc bmake and NetBSD-1.6.2 /usr/bin/make, which has
been fixed at least in NetBSD-2.99.15. Wrote a testcase for it.
Diffstat (limited to 'regress')
-rw-r--r--regress/make-quoting/Makefile4
-rw-r--r--regress/make-quoting/files/bug1.mk36
-rw-r--r--regress/make-quoting/files/bug1.out1
3 files changed, 39 insertions, 2 deletions
diff --git a/regress/make-quoting/Makefile b/regress/make-quoting/Makefile
index 6bab0b9ae55..d3ea47bd3ef 100644
--- a/regress/make-quoting/Makefile
+++ b/regress/make-quoting/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2005/05/15 21:10:16 rillig Exp $
+# $NetBSD: Makefile,v 1.2 2005/05/15 22:50:13 rillig Exp $
#
DISTNAME= regress-make-1.0
@@ -9,7 +9,7 @@ MAINTAINER= rillig@NetBSD.org
COMMENT= Test Makefile quoting
REGRESS_TESTS= continue dblquote for ltarget nestfor quoting sglquote \
- vtarget
+ vtarget bug1
do-extract:
@${_PKG_SILENT}${_PKG_DEBUG} \
diff --git a/regress/make-quoting/files/bug1.mk b/regress/make-quoting/files/bug1.mk
new file mode 100644
index 00000000000..a1bdf7e8a23
--- /dev/null
+++ b/regress/make-quoting/files/bug1.mk
@@ -0,0 +1,36 @@
+# $NetBSD: bug1.mk,v 1.1 2005/05/15 22:50:13 rillig Exp $
+#
+# This file demonstrates a parsing bug in make(1) from NetBSD-1.6.2 and
+# the current pkgsrc bmake. The make from NetBSD-2.99.15 has been fixed.
+#
+# The bug is that one of the closing braces is parsed twice -- once as
+# terminator for a variable and once as literal character, which is
+# appended to PKG_OPTIONS.
+
+PKG_OPTIONS= a b c
+.for _o_ in -b -c
+_opt_:= ${_o_} # .for variables cannot be used in modifiers
+. if !empty(_opt_:M-*)
+PKG_OPTIONS:= ${PKG_OPTIONS:N${_opt_:C/-//}} # <-- the bug
+. endif
+.endfor
+
+PASSED?= no
+
+# /usr/bin/make from NetBSD 2.99.15 or similar
+.if !empty(MAKE_VERSION:Mnetbsd-2005*) && ${PKG_OPTIONS} == "a"
+PASSED= yes
+
+# /usr/bin/make from NetBSD 1.6.2
+.elif !empty(MAKE_VERSION:Mnetbsd-20040210) && ${PKG_OPTIONS} == "a b c}}"
+PASSED= yes
+
+# bmake from pkgsrc
+.elif !empty(MAKE_VERSION:Mbmake-3.1.12*) && ${PKG_OPTIONS} == "a b c}}"
+PASSED= yes
+
+.endif
+
+.PHONY: all
+all:
+ @echo ${PASSED}
diff --git a/regress/make-quoting/files/bug1.out b/regress/make-quoting/files/bug1.out
new file mode 100644
index 00000000000..7cfab5b05d6
--- /dev/null
+++ b/regress/make-quoting/files/bug1.out
@@ -0,0 +1 @@
+yes