m4-patches
[Top][All Lists]
Advanced

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

Re: use execute module in m4


From: Eric Blake
Subject: Re: use execute module in m4
Date: Fri, 13 Mar 2009 19:29:44 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 3/3/2009 6:39 AM:
> Here's the followup patches which switch to the pipe module for esyscmd,
> nuke code rendered dead now that gnulib takes care of separating signal
> from normal exit status, then adds ./configure --with-syscmd-shell to
> allow overriding the default choice of /bin/sh (or, on Solaris,
> /usr/xpg4/bin/sh).  I've tested this on several platforms, but won't push
> to savannah until I've ported it to branch-1.6 and master.

Now ported.  I also needed this patch when using a cross-compiler under
cygwin to build a mingw executable.  Mingw likes to output argv[0] as an
absolute path, and includes \ directory separators; but with the new
configure --with-syscmd-shell option, you can use sh instead of cmd as the
shell.  Passing __program__ through syscmd falls foul of sh quoting rules
(cmd may be insane in its quoting rules, but at least it deals with \ as a
directory separator instead of an escape, making life with the
brain-damaged choice of directory separator a bit easier).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm7CIgACgkQ84KuGfSFAYCc8wCgm7DSbySR+y9OEJ/yxAuFb2kM
9LAAoNZ9vXceHe52zGHtiDLxxfPiDnoh
=0/X/
-----END PGP SIGNATURE-----
From 4fd6e693ee229b5feec21a72434e6cb00621b0a5 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 13 Mar 2009 16:06:02 -0600
Subject: [PATCH] Fix testsuite failure on mingw.

* examples/null.m4: Don't attempt to recursively invoke
__program__ on mingw, since \ in file name can confuse some
choices for --with-syscmd-shell.
* examples/null.err: Adjust expected output.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    8 +++++++
 examples/null.err |   54 ++++++++++++++++++++++++++--------------------------
 examples/null.m4  |    3 +-
 3 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 06832b8..60f51ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-03-13  Eric Blake  <address@hidden>
+
+       Fix testsuite failure on mingw.
+       * examples/null.m4: Don't attempt to recursively invoke
+       __program__ on mingw, since \ in file name can confuse some
+       choices for --with-syscmd-shell.
+       * examples/null.err: Adjust expected output.
+
 2009-03-12  Eric Blake  <address@hidden>

        Fix awk script portability.
diff --git a/examples/null.err b/examples/null.err
index 32c85b3..930d917 100644
--- a/examples/null.err
+++ b/examples/null.err
@@ -28,48 +28,48 @@ errprint: -- --
 esyscmd:
 m4:examples/null.m4:85: Warning: esyscmd: argument `echo +\0+' truncated
 eval:
-m4:examples/null.m4:90: Warning: eval: bad input: `1\0+1'
-m4:examples/null.m4:92: Warning: eval: non-numeric argument `2\0002'
-m4:examples/null.m4:94: Warning: eval: non-numeric argument `1\0001'
+m4:examples/null.m4:91: Warning: eval: bad input: `1\0+1'
+m4:examples/null.m4:93: Warning: eval: non-numeric argument `2\0002'
+m4:examples/null.m4:95: Warning: eval: non-numeric argument `1\0001'
 format:
-m4:examples/null.m4:99: Warning: format: unrecognized specifier in `%\0%'
-m4:examples/null.m4:99: Warning: format: unrecognized specifier in `%\0%'
-m4:examples/null.m4:101: Warning: format: non-numeric argument `1\0001'
-m4:examples/null.m4:101: Warning: format: argument `-\0-' truncated
+m4:examples/null.m4:100: Warning: format: unrecognized specifier in `%\0%'
+m4:examples/null.m4:100: Warning: format: unrecognized specifier in `%\0%'
+m4:examples/null.m4:102: Warning: format: non-numeric argument `1\0001'
+m4:examples/null.m4:102: Warning: format: argument `-\0-' truncated
 include:
-m4:examples/null.m4:110: Warning: include: argument `/no/such\0/file' truncated
-m4:examples/null.m4:110: include: cannot open `/no/such': No such file or 
directory
+m4:examples/null.m4:111: Warning: include: argument `/no/such\0/file' truncated
+m4:examples/null.m4:111: include: cannot open `/no/such': No such file or 
directory
 incr:
-m4:examples/null.m4:113: Warning: incr: non-numeric argument `1\0001'
+m4:examples/null.m4:114: Warning: incr: non-numeric argument `1\0001'
 index:
-m4:examples/null.m4:119: Warning: index: non-numeric argument `1\0001'
+m4:examples/null.m4:120: Warning: index: non-numeric argument `1\0001'
 indir:
-m4:examples/null.m4:124: Warning: indir: undefined macro `\0-\0'
-m4:examples/null.m4:126: Warning: \0\0%%: extra arguments ignored: 1 > 0
+m4:examples/null.m4:125: Warning: indir: undefined macro `\0-\0'
+m4:examples/null.m4:127: Warning: \0\0%%: extra arguments ignored: 1 > 0
 maketemp:
-m4:examples/null.m4:137: Warning: maketemp: recommend using mkstemp instead
-m4:examples/null.m4:137: Warning: maketemp: argument `/no/such\0/file' 
truncated
-m4:examples/null.m4:137: Warning: maketemp: cannot create file from template 
`/no/such': No such file or directory
+m4:examples/null.m4:138: Warning: maketemp: recommend using mkstemp instead
+m4:examples/null.m4:138: Warning: maketemp: argument `/no/such\0/file' 
truncated
+m4:examples/null.m4:138: Warning: maketemp: cannot create file from template 
`/no/such': No such file or directory
 mkstemp:
-m4:examples/null.m4:140: Warning: mkstemp: argument `/no/such\0/file' truncated
-m4:examples/null.m4:140: Warning: mkstemp: cannot create file from template 
`/no/such': No such file or directory
+m4:examples/null.m4:141: Warning: mkstemp: argument `/no/such\0/file' truncated
+m4:examples/null.m4:141: Warning: mkstemp: cannot create file from template 
`/no/such': No such file or directory
 patsubst:
-m4:examples/null.m4:143: Warning: patsubst: bad regular expression `\\\0\\': 
Trailing backslash
+m4:examples/null.m4:144: Warning: patsubst: bad regular expression `\\\0\\': 
Trailing backslash
 popdef:
-m4:examples/null.m4:158: Warning: popdef: undefined macro `-\0-'
+m4:examples/null.m4:159: Warning: popdef: undefined macro `-\0-'
 regexp:
-m4:examples/null.m4:165: Warning: regexp: bad regular expression `\\\0\\': 
Trailing backslash
+m4:examples/null.m4:166: Warning: regexp: bad regular expression `\\\0\\': 
Trailing backslash
 sinclude:
-m4:examples/null.m4:180: Warning: sinclude: argument `/no/such\0/file' 
truncated
+m4:examples/null.m4:181: Warning: sinclude: argument `/no/such\0/file' 
truncated
 substr:
-m4:examples/null.m4:185: Warning: substr: non-numeric argument `1\0001'
-m4:examples/null.m4:187: Warning: substr: non-numeric argument `1\0001'
+m4:examples/null.m4:186: Warning: substr: non-numeric argument `1\0001'
+m4:examples/null.m4:188: Warning: substr: non-numeric argument `1\0001'
 syscmd:
-m4:examples/null.m4:192: Warning: syscmd: argument `echo +\0+' truncated
+m4:examples/null.m4:193: Warning: syscmd: argument `echo +\0+' truncated
 traceon:
 m4trace: -1- --(`--') -> `strange: --'
 m4trace: -1- body -> `-'
 undefine:
-m4:examples/null.m4:211: Warning: undefine: undefined macro `-\0-'
+m4:examples/null.m4:212: Warning: undefine: undefined macro `-\0-'
 undivert:
-m4:examples/null.m4:214: Warning: undivert: invalid file name `1\0001'
+m4:examples/null.m4:215: Warning: undivert: invalid file name `1\0001'
diff --git a/examples/null.m4 b/examples/null.m4
index 5c78557..dcb6139 100644
--- a/examples/null.m4
+++ b/examples/null.m4
@@ -84,7 +84,8 @@ dnl Passed to esyscmd:
 `esyscmd:'errprint(`esyscmd:
 ') esyscmd(`echo ++')sysval dnl
 dnl Generated from esyscmd:
-esyscmd(__program__` -DNUL '__file__) sysval
+changequote(`{',`}')ifdef({__unix__},
+{esyscmd('__program__{' -DNUL '}__file__')}, {[]})changequote sysval
 dnl First argument of eval:
 errprint(`eval:
 ')eval(`1+1')dnl
-- 
1.6.1.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]