pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/regress/make-quoting Found a bug in the pkgsrc bmake a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3cbe7b42b719
branches:  trunk
changeset: 493860:3cbe7b42b719
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun May 15 22:50:13 2005 +0000

description:
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:

 regress/make-quoting/Makefile       |   4 ++--
 regress/make-quoting/files/bug1.mk  |  36 ++++++++++++++++++++++++++++++++++++
 regress/make-quoting/files/bug1.out |   1 +
 3 files changed, 39 insertions(+), 2 deletions(-)

diffs (63 lines):

diff -r 3bac211d27b8 -r 3cbe7b42b719 regress/make-quoting/Makefile
--- a/regress/make-quoting/Makefile     Sun May 15 22:37:46 2005 +0000
+++ b/regress/make-quoting/Makefile     Sun May 15 22:50:13 2005 +0000
@@ -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 @@
 COMMENT=       Test Makefile quoting
 
 REGRESS_TESTS= continue dblquote for ltarget nestfor quoting sglquote  \
-       vtarget
+       vtarget bug1
 
 do-extract:
        @${_PKG_SILENT}${_PKG_DEBUG}                                    \
diff -r 3bac211d27b8 -r 3cbe7b42b719 regress/make-quoting/files/bug1.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/make-quoting/files/bug1.mk        Sun May 15 22:50:13 2005 +0000
@@ -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 -r 3bac211d27b8 -r 3cbe7b42b719 regress/make-quoting/files/bug1.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/make-quoting/files/bug1.out       Sun May 15 22:50:13 2005 +0000
@@ -0,0 +1,1 @@
+yes



Home | Main Index | Thread Index | Old Index