Re: automake results on OpenBSD 4.0

2008-01-23 Thread Eric Blake
Eric Blake ebb9 at byu.net writes:

 
 +# Check that grep can parse nonprinting characters
 +# BSD grep can do so from a pipe, but not a file.

Maybe we should also add a line:
+# BSD 'grep -a' does just fine from files, but 'grep -a' is not portable.

 -  grep : pass stdout | $FGREP $grn
 +  cat stdout | grep : pass | $FGREP $grn

Wow - I wrote something that superficially looks like a useless use of cat, but 
which actually changes the test outcome.

-- 
Eric Blake






Re: automake results on OpenBSD 4.0

2008-01-23 Thread Eric Blake

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[shifting this conversation to autoconf-patches; see
http://thread.gmane.org/gmane.comp.sysutils.automake.bugs/4096/focus=4100
for the thread]

According to Ralf Wildenhues on 1/23/2008 3:03 PM:
| Hi Eric,
|
| * Eric Blake wrote on Wed, Jan 23, 2008 at 06:34:10PM CET:
| I'm not sure if grep -a is portable (POSIX doesn't require it),
|
| AIX grep has no -a.
|
| so is the following patch appropriate (and should we also mention
| this in the autoconf manual)?
|
| FWIW, as a general (hand-waving) rule, I would rather use POSIX as base
| from which to document deviations, than BSD or GNU features.  That way
| the Autoconf manual doesn't end up documenting all extensions as such.

Agreed.  However, the bit about BSD grep behaving differently based on
whether input is seekable may be useful to more than this automake test,
so I'd like to commit this, if others agree.

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

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHmAWW84KuGfSFAYARAmzkAKDAp0s84TlvHdbLzwk7VSLx21lYCQCbBkdL
aWsthjhKSm4CoMa8XalTuzU=
=7dx0
-END PGP SIGNATURE-
From a803dd80b30ec5758c3e1656296b411d990a591b Mon Sep 17 00:00:00 2001
From: Eric Blake [EMAIL PROTECTED]
Date: Wed, 23 Jan 2008 20:24:47 -0700
Subject: [PATCH] * doc/autoconf.texi (Limitations of Usual Tools) grep: 
Document
 BSD behavior on binary input.

Signed-off-by: Eric Blake [EMAIL PROTECTED]
---
 ChangeLog |5 +
 doc/autoconf.texi |   14 ++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d42be11..68673b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-23  Eric Blake  [EMAIL PROTECTED]
+
+   * doc/autoconf.texi (Limitations of Usual Tools) grep: Document
+   BSD behavior on binary input.
+
 2008-01-23  Ralf Wildenhues  [EMAIL PROTECTED]
 
* doc/autoconf.texi (Particular Programs): Do not mention the
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 78628e5..556df41 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -14957,6 +14957,20 @@ Similarly, the following escape sequences should also 
be avoided:
 @samp{\}, @samp{\}, @samp{\+}, @samp{\?}, @samp{\`}, @samp{\'},
 @samp{\B}, @samp{\b}, @samp{\S}, @samp{\s}, @samp{\W}, and @samp{\w}.
 
+Posix does not specify behavior of binary files.  An example where this
+matters is using @acronym{BSD} @command{grep} to search for text
+embedded among @acronym{ANSI} escape sequences for colored output to
+terminals @command{grep} (where @samp{\033[m} is the sequence to restore
+normal output):
+
[EMAIL PROTECTED]
+$ @kbd{printf 'esc\033[mape\n'  sample}
+$ @kbd{grep . sample}
+Binary file sample matches
+$ @kbd{cat file | grep .}
+escape
[EMAIL PROTECTED] example
+
 
 @item @command{join}
 @c -
-- 
1.5.3.8



Re: automake results on OpenBSD 4.0

2008-01-22 Thread Ralf Wildenhues
Hi Eric,

* Eric Blake wrote on Wed, Jan 23, 2008 at 06:26:20AM CET:
 According to Eric Blake on 1/22/2008 10:22 PM:
 | FAIL: color.test
 | =
 | 1 of 526 tests failed
 | (95 tests were not run)
 | Please report to bug-automake@gnu.org
 | =
 |
 | I suspect this is because 'which expect' claims that expect is not
 | installed, in which case the test should be skipped rather than failed.
 
 This was on the master branch, not 1.10.1 (which doesn't have color
 support), tested on OpenBSD 4.0.

Can you post output of the following please?
  cd tests  TESTS=color.test VERBOSE=yes make -e check

Thank you,
Ralf




Re: automake results on OpenBSD 4.0

2008-01-22 Thread Eric Blake

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ralf Wildenhues on 1/22/2008 11:12 PM:
| |
| | I suspect this is because 'which expect' claims that expect is not
| | installed, in which case the test should be skipped rather than failed.
|
| This was on the master branch, not 1.10.1 (which doesn't have color
| support), tested on OpenBSD 4.0.
|
| Can you post output of the following please?
|   cd tests  TESTS=color.test VERBOSE=yes make -e check

Colors correctly displayed (at least via my rxvt terminal hosting the ssh
session to the machine in question).  I used the BSD make.

make  defs aclocal-1.10a automake-1.10a
`defs' is up to date.
`aclocal-1.10a' is up to date.
`automake-1.10a' is up to date.
make  check-TESTS
/home/ericb/automake/tests:/home/ericb/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
=== Running test ./color.test
+ pwd
/home/ericb/automake/tests/color.dir
+ set -e
+ TERM=ansi
+ export TERM
+ red=
+ grn=
+ lgn=
+ blu=
+ std=
+ cat
+  configure.in
+  END
+ cat
+  Makefile.am
+  END
+ cat
+  pass
+  END
+ cat
+  fail
+  END
+ cat
+  skip
+  END
+ cp fail xfail
+ cp pass xpass
+ chmod +x pass fail skip xpass xfail
+ aclocal-1.10a -Werror
+ automake-1.10a --foreign -Werror -Wall
+ autoconf
+ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
configure: creating ./config.status
config.status: creating Makefile
+ cat
+  expect-make
+  END
+ unset TESTS
+ make -e check
+  stdout
+ AM_COLOR_TESTS=always
+ cat stdout
make  pass fail skip xpass xfail
`pass' is up to date.
`fail' is up to date.
`skip' is up to date.
`xpass' is up to date.
`xfail' is up to date.
make  check-TESTS
PASS: pass
FAIL: fail
SKIP: skip
XPASS: xpass
XFAIL: xfail
=
2 of 4 tests did not behave as expected (1 unexpected passes)
(1 tests were not run)
=
*** Error code 1

Stop in /home/ericb/automake/tests/color.dir (line 268 of Makefile).
*** Error code 1

Stop in /home/ericb/automake/tests/color.dir (line 402 of Makefile).
+ test_color
: exit 1
FAIL: color.test
=
1 of 1 tests failed
Please report to bug-automake@gnu.org
=
*** Error code 1

Stop in /home/ericb/automake/tests (line 909 of Makefile).
*** Error code 1

Stop in /home/ericb/automake/tests (line 938 of Makefile).


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

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHlt/b84KuGfSFAYARAumMAJ0TTi+tIZpSh3TwAqSf3RUnRTOydgCfWIya
rp+0odWckIDYKJho886vflw=
=5u5z
-END PGP SIGNATURE-