automake-patches
[Top][All Lists]
Advanced

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

[FYI] {master} tests: avoid a "grep -E" portability issue


From: Stefano Lattarini
Subject: [FYI] {master} tests: avoid a "grep -E" portability issue
Date: Tue, 18 Dec 2012 12:04:38 +0100

As stated in the Autoconf manual, the empty alternative is not portable
with "grep -E".  For example, while with GNU grep we have:

    $ echo b | grep -E '(|a)b'; echo status = $?
    b
    status = 0

with Solaris 10 /usr/xpg4/bin/grep we have:

   $ echo b | grep -E '(|a)b'; echo status = $?
   1
   status = 1

* t/silent-texi.sh: That was causing a spurious failure here.  Fix it
by simply using '?' instead (as suggested by the Autoconf manual).

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/silent-texi.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/silent-texi.sh b/t/silent-texi.sh
index 358d068..3ddbc40 100755
--- a/t/silent-texi.sh
+++ b/t/silent-texi.sh
@@ -55,13 +55,13 @@ test $st -eq 0
 grep '^  DVIPS    foo\.ps$'         stdout
 grep '^  MAKEINFO foo\.html$'       stdout
 # NetBSD make will print './foo.info' instead of 'foo.info'.
-$EGREP '^  MAKEINFO (|\./)foo\.info$'       stdout
+$EGREP '^  MAKEINFO (\./)?foo\.info$' stdout
 grep '^  TEXI2DVI foo\.dvi$'        stdout
 grep '^  TEXI2PDF foo\.pdf$'        stdout
 grep '^  DVIPS    sub/zardoz.ps$'   stdout
 grep '^  MAKEINFO sub/zardoz.html$' stdout
 # NetBSD make will print './sub/zardoz.info' instead of 'zardoz.info'.
-$EGREP '^  MAKEINFO (|\./)sub/zardoz.info$' stdout
+$EGREP '^  MAKEINFO (\./)?sub/zardoz.info$' stdout
 grep '^  TEXI2DVI sub/zardoz.dvi$'  stdout
 grep '^  TEXI2PDF sub/zardoz.pdf$'  stdout
 # No make recipe is displayed before being executed.
-- 
1.8.0.1.347.gf94c325




reply via email to

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