On 06/03/16 16:16, Christian Weisgerber wrote:
> Nigel Taylor:
> 
>> Did you try the modified version of m4?
> 
> No.  What modified version of m4 is there?
> 
Under ~nigel on cvs.openbsd.org

The fixes are to make bison work. Made changes in Nov, diffs would need
updating now. Problem is still present in gtar with the newer version.

> I hadn't committed the update to 1.29 while I was examining the
> regression failures.  It's in the tree now.
> 

I've been having a look..

>> From what I see it works or I don't see what your seeing.
> 
> By default, the included tests/testsuite script is used.  To force
> it to be regenerated, touch one of the *.at source files.  The port
> now patches one of them.
> 

I can see the problem now, if you attempt to patch a test then
tests/testsuite is recreated. Could patch testsuite directly, then touch
after patching so newer than patches to tests.


>> The original input file tests/onetop05.at contains (mkdir d1
>> the only time ( would be removed if it was a m4 macro parameter list, or had 
>> been 
>> set as a quote.
> 
> Hmm, I guess only sigpipe and remfiles01 fail: "tar" is macro-expanded,
> and "(tar" causes the problem.  This is a partial diff of the included
> testsuite script (-) and the one regenerated with base m4 (+):
> 
> @@ -38992,7 +39008,7 @@
>  #             <[email protected]>
>  
>  { set +x
> -$as_echo "$at_srcdir/sigpipe.at:30:
> +$as_echo "$at_srcdir/sigpipe.at:42: (
>  
>  case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #(
>  ?*) exit 77;;
> @@ -39008,8 +39024,8 @@
>  # Discard diagnostics that some shells generate about broken pipes.
>  (tar tf archive 2>&3 | :) 3>&2 2>/dev/null
>  "
> -at_fn_check_prepare_notrace 'a `...` command substitution' "sigpipe.at:30"
> -( $at_check_trace;
> +at_fn_check_prepare_notrace 'a `...` command substitution' "sigpipe.at:42"
> +( $at_check_trace; (
>  
>  case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
>  ?*) exit 77;;
> 

This shows one of the fixes made file:line __line__ for normal m4 is the
last line, gm4 the line is start of the macro. The modifed m4 -g will
give the __line__ as 30.

When tracing problems the output from gm4 and m4 -g matches a lot more
closely making it easier to find problems/differences.

m4 also reports the wrong filename __file__ only seen if included files
are used. Then you get the line number in the wrong file.

The outstanding problems are mainly complex m4 where the internal gm4
workings are used to enhance performance. A macro that uses itself
within it's definition.


I've tried other autoconf versions they all fail, and gtar 1.28 would
also fail

The problem is with the AT_SIGPIPE_PREREQ marco

$ grep SIGPIPE *.at
remfiles01.at:AT_SIGPIPE_PREREQ
remfiles01.at:# Depending on when the SIGPIPE gets delivered, the
invocation below
sigpipe.at:AT_SIGPIPE_PREREQ


The macro is in testsuite.at

Attached diff, removes gm4 and changes testsuite.at adds extra level of
quotes, other methods of fixing could involve patching all autoconf
versions.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/archivers/gtar/Makefile,v
retrieving revision 1.78
diff -u -p -r1.78 Makefile
--- Makefile	3 Jun 2016 14:53:32 -0000	1.78
+++ Makefile	4 Jun 2016 23:49:12 -0000
@@ -49,8 +49,6 @@ LDSTATIC=
 TEST_DEPENDS=	devel/autoconf/2.69
 TEST_ENV=	AUTOCONF_VERSION=2.69
 # without GNU m4, commands with leading parenthesis are mis-expanded
-TEST_DEPENDS+=	devel/m4
-TEST_ENV+=	M4=${LOCALBASE}/bin/gm4
 
 # do not rebuild tar.info
 post-patch:
Index: patches/patch-tests_testsuite_at
===================================================================
RCS file: patches/patch-tests_testsuite_at
diff -N patches/patch-tests_testsuite_at
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_testsuite_at	4 Jun 2016 23:48:09 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- tests/testsuite.at.orig	Wed Apr  6 06:02:04 2016
++++ tests/testsuite.at	Sun Jun  5 00:47:40 2016
+@@ -82,7 +82,7 @@ cat /dev/null | m4_if([$1],[],gzip,[$1]) - > /dev/null
+ 
+ dnl AT_SIGPIPE_PREREQ - Skip test unless SIGPIPE handling is the default
+ m4_define([AT_SIGPIPE_PREREQ],[
+-case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
++case `(cat "$at_myself" 2>&3 | :[)] 3>&1 >/dev/null` in #(
+ ?*) AT_SKIP_TEST;;
+ esac
+ ])

Reply via email to