Re: minimum perl version

2010-09-04 Thread Bruno Haible
Hi Jim,

> However, I'd prefer to continue to report the offending version of Perl
> and the minimum required version.  One way to do that would be
> to not suppress stderr.

OK, as you like. I'm applying it like this:


2010-09-04  Bruno Haible  

update-copyright test: Improve output when perl is missing or too old.
* tests/test-update-copyright.sh: Move test of Perl version down after
the test whether Perl exists. Provide an explanation relating Perl's
error message to Automake's SKIP: message.

--- tests/test-update-copyright.sh.orig Sat Sep  4 13:56:40 2010
+++ tests/test-update-copyright.sh  Sat Sep  4 13:53:56 2010
@@ -16,10 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
 
-# Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
-# We have a report that 5.6.1 is inadequate and that 5.8.0 works.
-perl -e 'require 5.8.0' || exit 77
-
 diffout=`diff -u /dev/null /dev/null 2>&1`
 if test x"$diffout" = x"" && test $? -eq 0; then
   compare() { diff -u "$@"; }
@@ -54,6 +50,13 @@
 exit 77
   }
 
+# Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
+# We have a report that 5.6.1 is inadequate and that 5.8.0 works.
+perl -e 'require 5.8.0' || {
+  echo '$0: skipping this test; Perl version is too old' 1>&2
+  exit 77
+}
+
 # Do not let a different envvar setting perturb results.
 UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
 export UPDATE_COPYRIGHT_MAX_LINE_LENGTH



Re: minimum perl version

2010-09-04 Thread Jim Meyering
Bruno Haible wrote:
> Hi Jim,
>
>> diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
>> index 2d1022a..607928d 100755
>> --- a/tests/test-update-copyright.sh
>> +++ b/tests/test-update-copyright.sh
>> @@ -16,6 +16,10 @@
>>  # You should have received a copy of the GNU General Public License
>>  # along with this program.  If not, see .
>>
>> +# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
>> +# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
>> +perl -e 'require 5.6.0' || exit 77
>> +
>>  diffout=`diff -u /dev/null /dev/null 2>&1`
>>  if test x"$diffout" = x"" && test $? -eq 0; then
>>compare() { diff -u "$@"; }
>
> A little down in this test, there is a check whether perl exists at all.
> It makes no sense IMO to test the perl version, risking a message to stderr
> if it is missing, and then afterwards to test whether perl exists.
>
> Also, when the test is skipped, we should output an explanation why.
> This explanation has already uncovered bugs. A message like
>   "Perl v5.8.0 required--this is only v5.6.0, stopped at -e line 1."
> sounds more like an error message than like an explanation why a test is
> being skipped.
>
> How about this proposed change?
...
>
> + # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
> + # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
> + perl -e 'require 5.8.0' 2>/dev/null || {
> +   echo '$0: skipping this test; Perl version is too old' 1>&2
> +   exit 77
> + }

Hi Bruno,

Thanks.  Moving the new test down is a definite improvement.
However, I'd prefer to continue to report the offending version of Perl
and the minimum required version.  One way to do that would be
to not suppress stderr.



Re: minimum perl version

2010-09-04 Thread Bruno Haible
Hi Jim,

> diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
> index 2d1022a..607928d 100755
> --- a/tests/test-update-copyright.sh
> +++ b/tests/test-update-copyright.sh
> @@ -16,6 +16,10 @@
>  # You should have received a copy of the GNU General Public License
>  # along with this program.  If not, see .
> 
> +# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
> +# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
> +perl -e 'require 5.6.0' || exit 77
> +
>  diffout=`diff -u /dev/null /dev/null 2>&1`
>  if test x"$diffout" = x"" && test $? -eq 0; then
>compare() { diff -u "$@"; }

A little down in this test, there is a check whether perl exists at all.
It makes no sense IMO to test the perl version, risking a message to stderr
if it is missing, and then afterwards to test whether perl exists.

Also, when the test is skipped, we should output an explanation why.
This explanation has already uncovered bugs. A message like
  "Perl v5.8.0 required--this is only v5.6.0, stopped at -e line 1."
sounds more like an error message than like an explanation why a test is
being skipped.

How about this proposed change?


2010-09-04  Bruno Haible  

update-copyright test: Improve output when perl is missing or too old.
* tests/test-update-copyright.sh: Move test of Perl version down after
the test whether Perl exists. Provide an explanation why the test is
skipped.

*** tests/test-update-copyright.sh.orig Sat Sep  4 12:24:31 2010
--- tests/test-update-copyright.sh  Sat Sep  4 12:24:26 2010
***
*** 16,25 
  # You should have received a copy of the GNU General Public License
  # along with this program.  If not, see .
  
- # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
- # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
- perl -e 'require 5.8.0' || exit 77
- 
  diffout=`diff -u /dev/null /dev/null 2>&1`
  if test x"$diffout" = x"" && test $? -eq 0; then
compare() { diff -u "$@"; }
--- 16,21 
***
*** 51,56 
--- 50,62 
  exit 77
}
  
+ # Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
+ # We have a report that 5.6.1 is inadequate and that 5.8.0 works.
+ perl -e 'require 5.8.0' 2>/dev/null || {
+   echo '$0: skipping this test; Perl version is too old' 1>&2
+   exit 77
+ }
+ 
  # Do not let a different envvar setting perturb results.
  UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
  export UPDATE_COPYRIGHT_MAX_LINE_LENGTH



Re: minimum perl version

2010-09-02 Thread Jim Meyering
Tom G. Christensen wrote:

> On Thu, Sep 02, 2010 at 01:53:54PM +0200, Jim Meyering wrote:
>> Sure. I've just pushed the following.
>> Can someone confirm that 5.6.0 works, or even
>> find what precise version is barely new enough?
>>
> I just tried the test on RHEL 2.1 with perl 5.6.1
> and it fails in the same way.
>
> The test works on RHEL 3 with perl 5.8.0.

Thanks, Tom.
Updated like this:

>From 132c58b713b628b98e0e5492a40cc16abe8f16ec Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Thu, 2 Sep 2010 17:53:36 +0200
Subject: [PATCH] test-update-copyright.sh: require perl 5.8.0

* tests/test-update-copyright.sh: Require 5.8.0,
which Tom G. Christensen has confirmed is adequate,
while 5.6.1 is not.
---
 ChangeLog  |7 +++
 tests/test-update-copyright.sh |6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 74e4991..93c6b1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-02  Jim Meyering  
+
+   test-update-copyright.sh: require perl 5.8.0
+   * tests/test-update-copyright.sh: Require 5.8.0,
+   which Tom G. Christensen has confirmed is adequate,
+   while 5.6.1 is not.
+
 2010-09-02  Eric Blake  

wctype: fix typo in previous commit
diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
index 607928d..09ade03 100755
--- a/tests/test-update-copyright.sh
+++ b/tests/test-update-copyright.sh
@@ -16,9 +16,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .

-# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
-# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
-perl -e 'require 5.6.0' || exit 77
+# Skip this test if Perl is too old.  FIXME: 5.8.0 is just a guess.
+# We have a report that 5.6.1 is inadequate and that 5.8.0 works.
+perl -e 'require 5.8.0' || exit 77

 diffout=`diff -u /dev/null /dev/null 2>&1`
 if test x"$diffout" = x"" && test $? -eq 0; then
--
1.7.2.2.510.g7180a



Re: minimum perl version

2010-09-02 Thread Tom G. Christensen
On Thu, Sep 02, 2010 at 01:53:54PM +0200, Jim Meyering wrote:
> Sure. I've just pushed the following.
> Can someone confirm that 5.6.0 works, or even
> find what precise version is barely new enough?
> 
I just tried the test on RHEL 2.1 with perl 5.6.1
and it fails in the same way.

The test works on RHEL 3 with perl 5.8.0.



-tgc



Re: minimum perl version

2010-09-02 Thread Jim Meyering
Eric Blake wrote:
> On 09/01/2010 12:48 PM, Tom G. Christensen wrote:
 +++ update-copyright.test-ex-stderr 2010-08-31 22:20:22.981772600 +0200
 @@ -1,2 +1 @@
 -update-copyright.test-ex.4: warning: FSF copyright statement not found
 -update-copyright.test-ex.5: warning: FSF copyright statement not found
 +./test-update-copyright.sh[95]: update-copyright:  not found
>>>
>>> Regex gone wrong somewhere?  Maybe due to an older perl bug?  What
>>> version of perl are you using?
>>>
>> It picked up the system perl in /usr/sbin which is 5.004_05.
>>
>> Rerunning with nekoware perl (5.8.8) first in the path fixes this.
>
> Sounds like we should be requiring a minimum version of perl in
> build-aux/update-copyright, and teaching test-update-copyright to skip
> if perl is not that new.  Jim, my perl is quite weak, would you mind
> taking this one?

Sure. I've just pushed the following.
Can someone confirm that 5.6.0 works, or even
find what precise version is barely new enough?

>From e2c4d9f8d8e1c87f861e6d62bdfe6c6136945c05 Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Thu, 2 Sep 2010 13:51:56 +0200
Subject: [PATCH] test-update-copyright.sh: skip test if Perl is too old

* tests/test-update-copyright.sh: Exit 77 if Perl is too old.
Reported by Tom G. Christensen.
---
 ChangeLog  |6 ++
 tests/test-update-copyright.sh |4 
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index edb5ab5..239d4b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-02  Jim Meyering  
+
+   test-update-copyright.sh: skip test if Perl is too old
+   * tests/test-update-copyright.sh: Exit 77 if Perl is too old.
+   Reported by Tom G. Christensen.
+
 2010-09-02  Bruno Haible  

wctype: Avoid compilation error on IRIX 6.5.30.
diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
index 2d1022a..607928d 100755
--- a/tests/test-update-copyright.sh
+++ b/tests/test-update-copyright.sh
@@ -16,6 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .

+# Skip this test if Perl is too old.  FIXME: 5.6.0 is just a guess.
+# We have a report that 5.004_05 is inadequate and that 5.8.8 works.
+perl -e 'require 5.6.0' || exit 77
+
 diffout=`diff -u /dev/null /dev/null 2>&1`
 if test x"$diffout" = x"" && test $? -eq 0; then
   compare() { diff -u "$@"; }
--
1.7.2.2.510.g7180a