Re: explain that some things may be built in make dist/DIST_SUBDIRS

2010-02-22 Thread Ralf Wildenhues
Hello Patrice,

thanks for the report and patch.

* Patrice Dumas wrote on Sun, Feb 21, 2010 at 11:59:06AM CET:
> I was confused by the fact that things in DIST_SUBDIRS
> are not meant to be built nor installed, but that still
> some files are built, namely the files needing some 
> special tools to be built.

I'm confused by this description.  Care to explain in a bit
more detail (maybe with a small example) what you mean here?
I assume you mean that, when `make dist' recurses in these
directories, also all prerequisites of `distdir' in these
directories get updated?

Or do you see files below non-SUBDIRS subdirectories which
are updated at `make all' time?

> I made a patch for the 
> documentation. Maybe this should also be more explicit
> in the coding standards, such that this is done for 
> everything and not only automake generated rules and gettext
> files.

Maybe, can't judge until I understand the former.

Thanks,
Ralf

> If you really want a ChangeLog entry, (but you can omit
> it if you like), it could be along
> 
> State that in DIST_SUBDIRS (in make dist) files that need 
> special tools to be generated (info manual, yacc generated 
> files) will be built.

> --- a/doc/automake.texi
> +++ b/doc/automake.texi
> @@ -4182,7 +4182,12 @@ build.  Recall our example where we may not want to 
> build subdirectory
>  
>  Precisely, @code{DIST_SUBDIRS} is used by @samp{make
>  maintainer-clean}, @samp{make distclean} and @samp{make dist}.  All
> -other recursive rules use @code{SUBDIRS}.
> +other recursive rules use @code{SUBDIRS}. Files that may need some
> +special tools to be generated, for example info manuals @ref{Texinfo} 
> +or Yacc and Lex generated files @ref{Yacc and Lex} will also be built
> +as part of @samp{make dist}.  Therefore, putting these files in 
> +...@code{dist_subdirs} directories is not enough to prevent them 
> +from being built.
>  
>  If @code{SUBDIRS} is defined conditionally using Automake
>  conditionals, Automake will define @code{DIST_SUBDIRS} automatically




Re: mdate-sh help msg

2010-02-22 Thread Ralf Wildenhues
Hi Karl,

* Karl Berry wrote on Mon, Feb 22, 2010 at 12:50:00AM CET:
> Suggestion for mdate-sh's --help message.  Obviously this is really
> crucial and urgent stuff :).

Applied, thanks!

Cheers,
Ralf

2010-02-22  Karl Berry  

Improve help message of mdate-sh.
* mdate-sh: mention actual output format in help message.

diff --git a/lib/mdate-sh b/lib/mdate-sh
index e631b22..c477512 100755
--- a/lib/mdate-sh
+++ b/lib/mdate-sh
@@ -1,10 +1,10 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2010-02-22.21; # UTC
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010
+# Free Software Foundation, Inc.
 # written by Ulrich Drepper , June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -38,7 +38,8 @@ case $1 in
 cat <<\EOF
 Usage: mdate-sh [--help] [--version] FILE
 
-Pretty-print the modification time of FILE.
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
 
 Report bugs to .
 EOF




Re: support for lzip

2010-02-22 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Sat, Feb 20, 2010 at 06:09:48PM CET:
> * Antonio Diaz Diaz wrote on Thu, Feb 18, 2010 at 07:28:07PM CET:
> > Ralf Wildenhues wrote:
> > >Well, to be honest, I regard the addition of lzma support as a mistake
> > >in hindsight.  We should have waited and added xz support only, with a
> > >stable xz release.  It was also a mistake that I did not deprecate lzma
> > >support more prominently in the 1.11 release; will fix that for 1.11.1.
> > 
> > It seems this has not been fixed in 1.11.1.
> 
> Darn.  Thanks for the reminder.

Done as follows.

Cheers,
Ralf

Deprecate dist-lzma in favor of dist-xz.

* doc/automake.texi (The Types of Distributions, Options):
Adjust text to reflect renaming of lzma to xz.
* NEWS: Update.
Missing deprecation noted by Antonio Diaz Diaz.

diff --git a/NEWS b/NEWS
index 2284680..a3ce191 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
 New in 1.11.0a:
 
+* Miscellaneous changes:
+
+  - The `lzma' compression scheme and associated automake option `dist-lzma'
+is obsoleted by `xz' and `dist-xz' due to upstream changes.
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11:
diff --git a/doc/automake.texi b/doc/automake.texi
index da4ac25..f319075 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8444,6 +8444,8 @@ The Types of Distributions
 @item @code{dist-lzma}
 Generate an @samp{lzma} tar archive of the distribution.  @command{lzma}
 archives are frequently smaller than @command{bzip2}-compressed archives.
+The @samp{lzma} format is obsolete, you should use the @samp{xz} format
+instead.
 @trindex dist-lzma
 
 @item @code{dist-shar}
@@ -8453,7 +8455,7 @@ The Types of Distributions
 @item @code{dist-xz}
 Generate an @samp{xz} tar archive of the distribution.  @command{xz}
 archives are frequently smaller than @command{bzip2}-compressed archives.
-The @samp{xz} format will soon (early 2009) displace the @samp{lzma} format.
+The @samp{xz} format displaces the obsolete @samp{lzma} format.
 @trindex dist-xz
 
 @item @code{dist-zip}
@@ -8992,7 +8994,7 @@ Options
 @item @option{dist-lzma}
 @cindex Option, @option{dist-lzma}
 @opindex dist-lzma
-Hook @code{dist-lzma} to @code{dist}.
+Hook @code{dist-lzma} to @code{dist}.  Obsoleted by @code{dist-xz}.
 @trindex dist-lzma
 
 @item @option{dist-shar}
@@ -9261,7 +9263,7 @@ Options
 These three mutually exclusive options select the tar format to use
 when generating tarballs with @samp{make dist}.  (The tar file created
 is then compressed according to the set of @option{no-dist-gzip},
-...@option{dist-bzip2}, @option{dist-lzma} and @option{dist-tarZ} options in 
use.)
+...@option{dist-bzip2}, @option{dist-xz} and @option{dist-tarZ} options in 
use.)
 
 These options must be passed as arguments to @code{AM_INIT_AUTOMAKE}
 (@pxref{Macros}) because they can require additional configure checks.




Re: support for lzip

2010-02-24 Thread Ralf Wildenhues
* Antonio Diaz Diaz wrote on Sat, Feb 20, 2010 at 09:02:32PM CET:
> Ralf Wildenhues wrote:
> >Thanks for the patch.  Care to add a ChangeLog entry?
> 
> I'll happily do so. You can find it in the attached file.

Thanks, also for the timing testing.  I'm adding a NEWS entry and
applying your patch to a new lzip-support branch off of the
(unpublished, but you can get at it easily through master^2 from a
merge) maint branch, and merging that to master.  Due to the changes
in dist handling in master, this was a nontrivial merge, the interesting
part shown below.

Pushed master.  Not yet sure whether this warrants backporting to
branch-1.11 but anyway we should first wait and see whether problems in
master show up.

Thanks again,
Ralf

commit 4147afc1cfed700fbcbefb797ae98a7ee7e5602a
Merge: d309207 3c3ff95
Author: Ralf Wildenhues 
Date:   Wed Feb 24 19:56:26 2010 +0100

Merge branch 'lzip-support'

* lzip-support:
  Add lzip compression support.

diff --cc NEWS
index ebb52d6,5374770..4f8f8bb
--- a/NEWS
+++ b/NEWS
@@@ -15,9 -5,9 +15,11 @@@ New in 1.11a
- The `lzma' compression scheme and associated automake option `dist-lzma'
  is obsoleted by `xz' and `dist-xz' due to upstream changes.
  
+   - "make dist" can now create lzip-compressed tarballs.
+ 
 -Bugs fixed in 1.11.0a:
 +Bugs fixed in 1.11a:
 +
 +  - Lots of minor bugfixes.
  
  * Bugs introduced by 1.11:
  
diff --cc lib/am/distdir.am
index 4e356b9,ad051c3..9459e75
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@@ -346,8 -342,14 +346,14 @@@ dist-gzip: distdi
  .PHONY: dist-bzip2
  dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
 -  $(am__remove_distdir)
 +  $(am__post_remove_distdir)
  
+ ?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
+ .PHONY: dist-lzip
+ dist-lzip: distdir
+   tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
 -  $(am__remove_distdir)
++  $(am__post_remove_distdir)
+ 
  ?LZMA?DIST_ARCHIVES += $(distdir).tar.lzma
  .PHONY: dist-lzma
  dist-lzma: distdir
@@@ -377,15 -379,7 +383,16 @@@ dist-shar: distdi
  dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
 -  $(am__remove_distdir)
 +  $(am__post_remove_distdir)
 +
 +?LZMA?DIST_TARGETS += dist-lzma
++?LZIP?DIST_TARGETS += dist-lzip
 +?XZ?DIST_TARGETS += dist-xz
 +?SHAR?DIST_TARGETS += dist-shar
 +?BZIP2?DIST_TARGETS += dist-bzip2
 +?GZIP?DIST_TARGETS += dist-gzip
 +?ZIP?DIST_TARGETS += dist-zip
 +?COMPRESS?DIST_TARGETS += dist-tarZ
  
  endif %?TOPDIR_P%
  




other/42980: fix make -j install

2010-02-28 Thread Ralf Wildenhues
'make -jN install' currently has a few race conditions causing
intermittent failures.

- 
  which has been fixed since, AFAICS, but
- 
  exposes a couple of separate issues:

a) The toplevel targets install-libiberty and install-target-libiberty
may both be executed, and in that case, the install_to_libdir rules from
libiberty/ may race with the same rules from $target/libiberty/ (quite
likely) or with those from a $target$MULTISUBDIR/libiberty (a lot less
likely, only a problem for header installation).

b) libgcc has a make recursion lacking $(MAKE), needed for parallel
submake.

c) Inside libgomp, libssp and libmudflap (and possibly other target
libraries), data (non-exec) install targets may race against the
respective targets of the same name in one of the other multilibs of the
same library.

Issue (a) and (b) are addressed in a followup ((a) concerns also a
src/combined tree); AFAICS only (a) has the chance to cause silent
breakage in the install tree.

There are a couple of ways to fix (c):

0) Forbid parallel install, in documentation or in code.  Since install
is mostly IO-bound (at least with the multi-file installations present
in the tree and in Automake 1.11), this is not a big problem.  OTOH,
users might have bigger iron still making it worthwhile; automated build
systems might just pass a parallel make from higher up,

1) in Automake: ensure that install-multi is not run concurrently with
install-exec-am or install-data-am or a prerequisite of these,

2) in all multilib directories: ensure that no file is ever installed
twice to the same location from a multilib directory.  This would
require going through all multilibbed directories, identify all files
installed in a common location (typically headers), and let only one of
the multilibs actually install them.

My gut feeling is that the latter is a maintenance hassle.  So below is
a proposed patch for Automake that implements (1).  The patch changes
semantics of multilibbed directories a bit: while formerly,
  cd $target/libFOO && make install-exec

would have invoked 'make install' in each $target$MULTISUBDIR/libFOO,
now install-exec remains local to the $target/libFOO subtree.  This
might have implications for non-GCC packages using multilibs.  GCC
itself does not seem to care much about the 'install' vs. 'install-data'
vs. 'install-exec' issues.

As an alternative solution, it would be possible to let each of
install-{data,exec} have multilib recursion semantics and let the
toplevel serialize each wrt. $MULTISUBDIRs.  That would require changing
config-ml.in, and haveing install-{data,exec}-multi, and a few ripples
throughout GCC and src.  Not implemented yet, but I can do that if it is
preferable.

My question for gcc-patches is whether you agree with this conclusion.
For actual inclusion in GCC, I think it's fine to wait until the next
time a new Automake release is used in GCC.

For now, I have commented out the (nonportable) loop to expose the race
condition in the Automake test suite, as it's currently far too unlikely
thus needs very long to ever trigger on systems I test.  Time for
$expensive_tests I guess.

Thanks,
Ralf

(Adding Gary to THANKS not shown)

Serialize multilib install rule, for concurrent same-file installs.

* lib/am/multilib.am: Typo fixes in comments.
(install-exec-am): Do not depend on install-multi.
* automake.in (handle_install): New transform %?MULTI%, for
toplevel multilib dirs.
* lib/am/install.am (install-am) [MULTI]: Invoke install-multi
in a sub-make, for ordering constraints.
* tests/multlib.test: Actually install a few headers and
libraries, so that a loop over `make -j install' has a chance of
eventually failing.
* NEWS, THANKS: Update.
Reported against GCC by Gary Funck in
.

diff --git a/NEWS b/NEWS
index 4f8f8bb..bafe37e 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,13 @@ Bugs fixed in 1.11a:
   - Several scripts as well as the parallel-tests testsuite driver now
 exit with the right exit status upon receiving a signal.
 
+  - The multilib `install' helper rule `install-multi' is now run off of
+the internal `install-am' rule rather than `install-exec-am', to avoid
+race conditions with parallel install due to mutliple versions of the
+same data files being installed by prerequisites of install-data-am.
+This changes implies that `make install-exec install-data' will not
+descend sibling multilib directories any more, you need to use `make
+install'.
 
 New in 1.11:
 
diff --git a/automake.in b/automake.in
index c0bf146..f7b5e07 100644
--- a/automake.in
+++ b/automake.in
@@ -4663,7 +4663,8 @@ sub handle_install ()
 : ''),
  'installdirs-local' => (user_phony_rule 'installdirs-local'
 ? ' installdirs-local' : 

Re: [PATCH] Add tests about support of wildcards in EXTRA_DIST

2010-03-03 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Wed, Mar 03, 2010 at 03:12:35PM CET:
> > > * tests/extra10.test: New test, check basic support of wildcards
> > > in EXTRA_DIST.
> > > * tests/extra11.test: New test, check more complex usage of
> > > wildcards in EXTRA_DIST.
> > > * tests/extra11.test: New test, check usage of wildcards in
> > > EXTRA_DIST when $builddir != $srcdir.
> D'oh! I managed to mess up the ChangeLog entry: this should be 
> `extra12.test', not `extra11.test'.

Thanks, and don't worry.

Cheers,
Ralf




Re: [PATCH] Remove redundant unset of variable TESTS from some test scripts.

2010-03-04 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, Mar 04, 2010 at 09:24:53PM CET:
> A simple cleanup patch.  Some test scripts still explicitly unset
> the `TESTS' variable, but this is no more required, since `TESTS'
> is unset in the `defs' script starting at least from commit
> 40c3936593bd5fc35a13641ad031445d419e38bf (Mon Apr 6 2009),
> The attached patch fixes this minor wart.

Thanks!
Ralf




Re: [BIKESHEDDING PATCH] Avoid generation of `tests/defs-p' file

2010-03-05 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, Mar 04, 2010 at 08:22:17PM CET:
> Here I propose a simple patch which tweaks the part of the testsuite 
> dealing with the `parallel-tests' Automake option.  Specifically, the 
> patch aims to get rid of the `tests/defs-p' file.

Thanks!  I'm applying it to maint after adding a copyright header to
tests/gen-parallel-tests and renaming am_parallel_tests to
parallel_tests throughout.  No need for the 'am_' prefix here IMVHO.
The maint version does not have the silencing prefixes in the make
rules in tests/Makefile.am, but the merge to master does.

Cheers,
Ralf




Formatting cleanups in macro comments.

2010-03-06 Thread Ralf Wildenhues
A trivial cleanup for maint.  Found by inspecting the quickfix list
generated by

  for f in `git ls-files`
  do
awk '{ len[NR] = length($0) }
 /*/ && len[NR-1] != 0 {
   if (len[NR-1] != len[NR])
 print FILENAME ":" NR ":" $0
 }' $f
  done

Cheers,
Ralf

Formatting cleanups in macro comments.

* automake.in, lib/Automake/Channels.pm,
lib/Automake/FileUtils.pm, lib/Automake/Options.pm,
lib/Automake/Variable.pm, lib/Automake/XFile.pm,
m4/options.m4, m4/substnot.m4: Fix macro comment format.

diff --git a/automake.in b/automake.in
index 8692d61..503c221 100755
--- a/automake.in
+++ b/automake.in
@@ -6468,7 +6468,7 @@ sub define_variable ($$$)
 
 
 # define_files_variable ($VAR, \...@basename, $EXTENSION, $WHERE)
-# ---
+# 
 # Define the $VAR which content is the list of file names composed of
 # a @BASENAME and the $EXTENSION.
 sub define_files_variable ($...@$$)
@@ -6606,7 +6606,7 @@ sub define_per_target_linker_variable ($$)
 
 
 # &check_trailing_slash ($WHERE, $LINE)
-# --
+# -
 # Return 1 iff $LINE ends with a slash.
 # Might modify $LINE.
 sub check_trailing_slash ($\$)
@@ -8017,7 +8017,7 @@ sub require_conf_file_with_macro ($$$@)
 
 
 # &require_build_directory ($DIRECTORY)
-# 
+# -
 # Emit rules to create $DIRECTORY if needed, and return
 # the file that any target requiring this directory should be made
 # dependent upon.
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index e94819e..223d8d2 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2004, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2006, 2008, 2010 Free Software Foundation,
+# Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -427,7 +428,7 @@ sub _format_message ($$%)
 }
 
 # _enqueue ($QUEUE, $KEY, $UNIQ_SCOPE, $TO_FILTER, $MSG, $FILE)
-# 
+# -
 # Push message on a queue, to be processed by another thread.
 sub _enqueue ($$)
 {
diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm
index 203c7de..e39750d 100644
--- a/lib/Automake/FileUtils.pm
+++ b/lib/Automake/FileUtils.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, 
Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -93,7 +94,7 @@ if absent, otherwise exit with error.
 
 # $FILE_NAME
 # find_file ($FILE_NAME, @INCLUDE)
-# ---
+# 
 sub find_file ($@)
 {
   use File::Spec;
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index cacc7d2..9543aa5 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009  Free Software Foundation, 
Inc.
+# Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -234,7 +235,7 @@ Return 1 on error, 0 otherwise.
 
 # $BOOL
 # _process_option_list (\%OPTIONS, $WHERE, @OPTIONS)
-# -
+# --
 # Process a list of options.  Return 1 on error, 0 otherwise.
 # \%OPTIONS is the hash to fill with options data, $WHERE is
 # the location where @OPTIONS occurred.
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f0c867f..8a5b568 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009  Free Software Foundation, 
Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1515,7 +1516,7 @@ sub _hash_values (@)
 }
 # ($VARNAME, $GENERATED)
 # _gen_varname ($BASE, @DEFINITIONS)
-# -
+# --
 # Return a variable name starting with $BASE, that will be
 # used to store definitions @DEFINITIONS.
 

Re: [PATCH] Improve timing of generation of generated test scripts.

2010-03-07 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Sun, Mar 07, 2010 at 05:28:19PM CET:
> Anothor small cosmetic patch; it adds the list of generated tests 
> ($(parallel_tests)) to the check_SCRIPTS variable, so that all the 
> automatically generated tests are created before starting to run any 
> test script in the testsuite.

That this is not done is on purpose: to demonstrate lazy updating.
In this case, it does not help all that much because test generation
is very fast, but it serves as example anyway; see e.g.,
.

Thanks,
Ralf




Re: [PATCH] Improve timing of generation of generated test scripts.

2010-03-13 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Mon, Mar 08, 2010 at 11:37:22AM CET:
> At Monday 08 March 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Sun, Mar 07, 2010 at 05:28:19PM CET:
> > > Anothor small cosmetic patch; it adds the list of generated tests
> > > ($(parallel_tests)) to the check_SCRIPTS variable, so that all
> > > the automatically generated tests are created before starting to
> > > run any test script in the testsuite.
> > 
> > That this is not done is on purpose: to demonstrate lazy updating.
> > In this case, it does not help all that much because test generation
> > is very fast, but it serves as example anyway; see e.g.,
> > <http://article.gmane.org/gmane.comp.sysutils.automake.general/11495>.
> Thanks for the information.  So my patch "fixed" a wanted behaviour, as
> I suspected.
> 
> But what would you think about adding a convenience target
> `generated-tests' to the Makefile so that one can easily regenerate
> all the generated test scripts without having to find out their names?
> Then we could also add a brief comment telling why $(TESTS) is not in
> check_SCRIPTS, and why `check' doesn't  depend on the
> `generated-tests' target.  WDYT?

distdir run by 'make dist' provides such a convenience target.  It does
a little more, but I've considered that sufficient so far.  The test
generation isn't exactly prone to failure.  ;-)

Thanks,
Ralf




Re: [BIKESHEDDING PATCH] Avoid generation of `tests/defs-p' file

2010-03-13 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Mar 07, 2010 at 03:47:24PM CET:
> However, I now see a minor problem in the ChangeLog:
>   
>  
> http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob;f=ChangeLog;h=d198ee643512bbebdfcf9ee13796ae595d055709;hb=03449117fa0f9c749708845a89dbc48a84673202
> 
> The last entry has the date "2010-03-03", while the preceding one has the
> date "2010-03-04".  Is this something intended, or a mistake?

I'll fix that.

Thanks!
Ralf




Re: hello uses fdl.texi, not gpl.texi

2010-03-13 Thread Ralf Wildenhues
Hi Karl,

* Karl Berry wrote on Sun, Mar 07, 2010 at 12:22:12AM CET:
> Some time ago I changed hello.texi to not @cinlude gpl.texi any more.
> May as well fix the example in the Automake manual.  Diff below.

Thanks!  Will merge.

Cheers,
Ralf




Re: automake.texi and @acronym

2010-03-28 Thread Ralf Wildenhues
* Karl Berry wrote on Fri, Mar 19, 2010 at 10:42:14PM CET:
> Is the intention that even the n...@acronym{gnu} cases should be
> replaced?  Then what purpose is the @acronym keyword for?
> 
> I wrote about that earlier.  Minor typographic change which is rarely
> used in GNU manuals.  De facto standard is not to use it.  Which is
> also simpler in the source.  To try to use it consistently/everywhere
> leads into deep waters (I have to do this in my TeX editorial life,
> and it is exceedingly time-consuming).  And it can't be used in node
> names in any case, so there will always be inconsistencies.  Do we
> have to keep going with this?

I think we've waited long enough for somebody to speak up, and the
current discussion didn't seem to turn the shed into a nuclear power
plant, so here we go.  Posting patches to the individual lists only.

I'll be pushing this to automake git soonish.

Thanks,
Ralf

Remove uses of @acronym and @sc.

* doc/automake.texi (Public Macros, Limitations on File Names):
Remove all usage of @acronym and @sc in the manual.
Suggested by Karl Berry.

diff --git a/doc/automake.texi b/doc/automake.texi
index 7df95ff..19e0224 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -17,7 +17,7 @@
 
 @copying
 
-This manual is for @acronym{GNU} Automake (version @value{VERSION},
+This manual is for GNU Automake (version @value{VERSION},
 @value{UPDATED}), a program that creates GNU standards-compliant
 Makefiles from template files.
 
@@ -27,11 +27,11 @@ Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the @acronym{GNU} Free Documentation License,
+under the terms of the GNU Free Documentation License,
 Version 1.3 or any later version published by the Free Software
 Foundation; with no Invariant Sections, with no Front-Cover texts,
 and with no Back-Cover Texts.  A copy of the license is included in the
-section entitled `...@acronym{gnu} Free Documentation License.''
+section entitled ``GNU Free Documentation License.''
 
 @end quotation
 @end copying
@@ -3841,7 +3841,7 @@ output variable @code{lispdir} to the full path to Emacs' 
site-lisp
 directory.
 
 Note that this test assumes the @command{emacs} found to be a version
-that supports Emacs Lisp (such as @sc{gnu} Emacs or XEmacs).  Other
+that supports Emacs Lisp (such as GNU Emacs or XEmacs).  Other
 emacsen can cause this test to hang (some, like old versions of
 MicroEmacs, start up in interactive mode, requiring @kbd{C-x C-c} to
 exit, which is hardly obvious for a non-emacs user).  In most cases,
@@ -10695,20 +10695,20 @@ names, and reserve @samp{/} as a directory separator. 
 Also, they
 require that file names are properly encoded for the user's locale.
 Automake is subject to these limits.
 
-Portable packages should limit themselves to @acronym{POSIX} file
-names.  These can contain @acronym{ASCII} letters and digits,
+Portable packages should limit themselves to POSIX file
+names.  These can contain ASCII letters and digits,
 @samp{_}, @samp{.}, and @samp{-}.  File names consist of components
 separated by @samp{/}.  File name components cannot begin with
 @samp{-}.
 
 Portable POSIX file names cannot contain components that exceed a
 14-byte limit, but nowadays it's normally safe to assume the
-more-generous @acronym{XOPEN} limit of 255 bytes.  @acronym{POSIX}
-limits file names to 255 bytes (@acronym{XOPEN} allows 1023 bytes),
+more-generous XOPEN limit of 255 bytes.  POSIX
+limits file names to 255 bytes (XOPEN allows 1023 bytes),
 but you may want to limit a source tarball to file names of 99 bytes
 to avoid interoperability problems with old versions of @command{tar}.
 
-If you depart from these rules (e.g., by using n...@acronym{ascii}
+If you depart from these rules (e.g., by using non-ASCII
 characters in file names, or by using lengthy file names), your
 installers may have problems for reasons unrelated to Automake.
 However, if this does not concern you, you should know about the
@@ -10738,12 +10738,12 @@ For example, the full name of the directory 
containing the source
 files should not contain these characters.
 
 Source and installation file names like @file{main.c} are limited even
-further: they should conform to the @acronym{POSIX}/@acronym{XOPEN}
+further: they should conform to the POSIX/XOPEN
 rules described above.  In addition, if you plan to port to
-n...@acronym{posix} environments, you should avoid file names that
+non-POSIX environments, you should avoid file names that
 differ only in case (e.g., @file{makefile} and @file{Makefile}).
 Nowadays it is no longer worth worrying about the 8.3 limits of
-...@acronym{dos} file systems.
+DOS file systems.
 
 @node distcleancheck
 @section Files left in build directory after distclean




Re: A couple of patches w.r.t. the target `path-check'

2010-03-30 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Tue, Mar 30, 2010 at 05:50:28PM CEST:
> However, I noticed that a lot of failures crop up with `make path-check',
> either with or without my patches installed (these failures are listed
> below).  So I have a question: is the `path-check' target still relevant?

Only for targets like DJGPP it would be relevant.  I'm not sure it makes
sense to try to accommodate it.  Without somebody showing a lot of
interest in it, and also be willing to regularly test both Autoconf and
Automake on this target, and keep it working there, I'd say don't bother
much with path-check.

> Or equivalently: is the Automake distribution really still expected to be
> successfully deployed on a host with the 14-characters length limit for
> filenames?  I personally don't even know if a such system is still used
> in practice, but I have no experience with ancient or "exotic" hosts at
> all, so you might know better.

DJGPP is the only one I know of that still exists.  The exact rules
required for it are documented in (autoconf.info)File System
Conventions.

Cheers,
Ralf




Re: [PATCH 1/2] Avoid another use of `chmod -R'.

2010-03-30 Thread Ralf Wildenhues
Hi Stefano,

thanks for the patch.

* Stefano Lattarini wrote on Tue, Mar 30, 2010 at 05:52:21PM CEST:
> * Makefile.am (path-check): To be safe, do not use `chmod -R' on
> $(distdir) before removing it (as Solaris `chmod -R' touches
> symlink targets).  Instead, use the cleanup strategy used in
> distdir.am (which is also employed in tests/defs.in).

I'm not sure I understand.  We are not putting any symlinks into
$(distdir), why would this be needed?

In order for symlinks to end up in $(distdir), you have to have a
dist-hook or similar rule, because normal distributed symlinks in the
source tree will be expanded as regular files in $(distdir).

Thanks,
Ralf




Re: [PATCH 2/2] Avoid an unportable use of `$status' shell variable.

2010-03-30 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Mar 30, 2010 at 05:54:03PM CEST:
> * Makefile.am (path-check): Don't use the `$status' shell variable
> in the target's rules, as it's special in Zsh (equivalent to `$?',
> and readonly).

Thanks!  Will push.

A very minor nit:

> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,13 @@
>  2010-03-30  Stefano Lattarini  
>  
> + Avoid an unportable use of `$status' shell variable.
> +
> + * Makefile.am (path-check): Don't use the `$status' shell variable

For future patches, please remove the empty line between summary line
and rest, it's customary to not have it in the ChangeLog, and only
really needed in the git log, for nice 'git log --oneline' output.

> + in the target's rules, as it's special in Zsh (equivalent to `$?',
> + and readonly).
> +
> +2010-03-30  Stefano Lattarini  
> +

Another minor nit: I usually merge two patches on the same day to have
only one author header line.  Some projects do it this way, some the
other.  I think GCS recommends it.

>   Avoid another use of `chmod -R'.

Thanks,
Ralf




Re: [PATCH 1/2] Avoid another use of `chmod -R'.

2010-03-31 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Mar 30, 2010 at 09:50:52PM CEST:
> At Tuesday 30 March 2010, Ralf Wildenhues wrote:
> > I'm not sure I understand.  We are not putting any symlinks into
> > $(distdir), why would this be needed?
> First, mostly for consistency with other cleanup rules (those in 
> `tests/defs.in', `tests/Makefile.am' and `lib/am/distdir.am'),

But all of those rules are about directories in which we may put
symlinks.

> and 
> second, to cater for the (admittedly very unlikely) case that a
> dist-hook will be added that puts a symlink in $(distdir), or that a 
> bug will be introduced that ends up putting a symlink in $(distdir)
> somehow.

I wouldn't want to hide a bug preemptively, if that means it won't show
up here but only with user packages.

> > In order for symlinks to end up in $(distdir), you have to have a
> > dist-hook or similar rule, because normal distributed symlinks in
> >  the source tree will be expanded as regular files in $(distdir).
> I must admit that I forgot the existence this "symlink-resolving" 
> feature...
> 
> By the way, is it tested in the testsuite?  I couldn't find anything 
> relevant by grepping the test scripts.

A testsuite addition that covers this would be welcome.  Be sure to not
fail if the system doesn't support symlinks (MinGW will emulate ln -s
with cp -p).

Thanks,
Ralf




Re: [PATCH 0/3] Enable `errexit' a.k.a. `set -e' shell flag in all test scripts.

2010-04-03 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Wed, Mar 31, 2010 at 01:24:05PM CEST:
> I'll soon post a couple of patches enabling the `errexit' a.k.a. `set -e' 
> shell flag unconditionally in all test scripts.  This helps making the 
> behaviour of different test scripts globally more consistent, and helps 
> catching potential bugs that could lead to false negatives (which are 
> very bad in a testsuite IMO).

errexit handling is quite inconsistent between different proprietary
shells, with many bugs lurking, also in some corner cases.  The Autoconf
manual has some anectodes.  These changes would require me to recheck
all kinds of such systems and shells for regressions, and it would
require in-depth inspection of the testsuite logs for false negatives.
Checking Solaris and heirloom sh is not enough, I'm afraid.

I don't have time to do this ATM, but I cannot accept the patches
without somebody having done this work.  On that basis I'm afraid
I'll have to drop these patches for now.  Sorry you invested all that
work, maybe it would be better to ask next time before you delve into
bigger issues.  I hope that at least the copyright year update was
done automatically with the gnulib machinery and not manually.

More generally, when not thinking about it much, I tend to prioritize
patches based upon both "how little work does this cause for me" and
"how big is the perceived improvement this patch brings".  When thinking
about it, I should prioritize the former less, and the latter maybe too
and instead focus on getting back to some FIFO state.  This patch
series, I'm afraid, won't score high on either series, except for the
"for free" fixes.

> By the way, the patches does actually fix "for free" some test scripts
> in which failures could have easily gone undetected; this happended
> because these tests acted like the `errexit' flag was active, but forgot
> to ever set it.

It would be nice to have fixes for these actual issues.  Thanks.
(Even if I had accepted the original patches, it would have nice to have
seen these tests mentioned specifically, at least in cases where you
know about them).

Another ChangeLog style remark: please don't list all files if you
really adjust all files.  In that case it is sufficient to say 'All
tests adjusted.' or so, and only list the non-repetetive changes like
for defs.in.  See (standards.info)Simple Changes.

> An outstanding example of this problem is the test `cond46.test',
> in which the `errexit' flag is off, and which "checks" various expected 
> Automake failures using the idiom:
>   AUTOMAKE_fails
>   grep DIAGNOSTIC stderr
> thus forgetting to call `Exit 1' if the expected diagnostic is not found,
> i.e. not signaling the error to the test driver.
> Other examples of this problem can be found e.g. in `confh5.test' and
> `dejagnu7.test'.

Yes, I'd like to see separate fixes for these.  Thanks.

Cheers,
Ralf




Re: [PATCH 1/2] Avoid another use of `chmod -R'.

2010-04-03 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Wed, Mar 31, 2010 at 11:17:21PM CEST:
> At Wednesday 31 March 2010, Ralf Wildenhues wrote:
> > Stefano Lattarini wrote
> > > Ralf Wildenhues wrote:
> > > > I'm not sure I understand.  We are not putting any symlinks
> > > > into $(distdir), why would this be needed?
> > [CUT]
> > > to cater for the (admittedly very unlikely) case that a
> > > dist-hook will be added that puts a symlink in $(distdir), or
> > > that a bug will be introduced that ends up putting a symlink in
> > > $(distdir) somehow.
> > 
> > I wouldn't want to hide a bug preemptively, if that means it won't
> >  show up here but only with user packages.
> That's a good objection, but the problem with this "theoretical" bug 
> is that it could manifest *silently*, and go unnoticed for a long 
> time.  The better option is to extend the testsuite to preemptively 
> look for the possible bug.  Once that's done, we can leave alone the 
> "chmod -R" (even If I'd like a comment saying "chmod -R is safe here 
> because $(distdir) doesn't contain symlinks", but that's just 
> nitpicking).

OK ok, I'll take the patch.

Thanks,
Ralf




Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-04-03 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Wed, Mar 31, 2010 at 02:11:16PM CEST:
> > Generated tests are now just a thin layer around other tests.
> > 
> > * tests/Makefile.am: Rewrite the rule to generate the `*-p.test'
> > test scripts so that any of them simply includes the corresponding
> > `*.test' script (after setting `$parallel_tests' to `yes').
> > * tests/.gitignore: Add wildcard for temporary files used in the
> > generation of `*-p.test' tests.
> > 
> > -*-*-
> Sorry if I ping this trivial patch, but it seems simple enough to be 
> applied easily if it's deemed worth, and if it's not deemed woth I'd 
> like to understand why.

Sorry for dropping the ball on this patch.  Some make implementations
detect '#' as starting a comment even in the middle of a variable (Posix
warns about this), but I can't find an offending make now which does so
when the '#' is within a command.  Posix doesn't seem clear to me on
this issue however.  Oh well, I guess I'll take the patch.

And yes, pinging patches is certainly fine.

Thanks,
Ralf




Re: [PATCH] Check that symlinks are resolved by `make dist'.

2010-04-04 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Fri, Apr 02, 2010 at 12:29:49AM CEST:
> > I'll write a couple of tests soonish, making them SKIP'd if `ln -s'
> > fails, or if `test -h' fails when applied to the resulting
> >  "symlink".

Why?  I mean, it's fine to skip if 'ln -s' fails outright, but if it's
emulated by 'cp -p', there is no need to skip the test?

> > By the way, how is the Automake-generated Makefile expected to
> >  behave if a file in e.g. EXTRA_DIST is a broken symlink,
> ... this is still not tested (I don't know what result should be 
> expected in such a situation), and...

Well, what happens currently?  (I hope 'make dist' fails.)

> >  or a symlink pointing to a directory?
> ... the test for this is xfailing, since a symlink pointing to a 
> directory is not expanded to the corresponding directory when
> copied in $(distdir); this is probably due to the use of `cp -fpR'
> as "directory-copying command" in distdir.am, where the `-R'
> option causes GNU cp not to resolve symlinks -- POSIX seems to
> leave unspecified the behaviour of `cp -R' w.r.t. symlinks, if I
> understand correctly the description at:
>  <http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html>
> 
> So what is the right thing to do about this -- patch distdir.am or 
> modify the semantic of the new test?

I don't think expanding the directory is desirable in this case.  It
could easily lead to file explosion.  I'm not sure whether to leave that
open as loop-hole for people wanting symlinks in the distribution, or to
offer an Automake option not to expand symlinks at all.

We don't need to hurry to define this unless and until we have a good
way to do so.  Let's leave this undefined.

> From ee859147f10c073a6d7bae822e6a4eb259f35e94 Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Wed, 31 Mar 2010 23:41:01 +0200
> Subject: [PATCH] Check that symlinks are resolved by `make dist'.
> 
> * tests/distsolvelinks.test: New test.

make that s/distsolvelinks/distlinks/ or so, that should be clear
enough.

> * tests/distsolvelinksdir.test: Likewise.
> * tests/Makefile.am (TESTS, XFAIL_TESTS): Updated accordingly.
> Suggested by observations from Ralf Wildenhues.


> --- /dev/null
> +++ b/tests/distsolvelinks.test

> +# Check that distributed symlinks in the source tree will be expanded
> +# as regular files in $(distdir).
> +
> +. ./defs || Exit 1
> +
> +set -e
> +
> +echo text > file
> +
> +ln -s file lnk \

> +  && cmp file lnk \
> +  && test -h lnk \
> +  && test ! -h file \

You can just omit these three lines I think,

> +  || {
> +echo "$me: cannot make and/or detect symlinks" >&2

... and adjust the message.

> +Exit 77
> +  }
> +
> +mkdir A
> +mkdir B
> +echo aaa > A/aaa
> +cd B
> +ln -s ../A/aaa bbb
> +cd ..
> +
> +echo FooBarBaz > foo
> +
> +ln -s foo  bar1
> +ln -s bar1 bar2
> +ln -s bar2 bar3
> +
> +ln -s "`pwd`/foo" quux
> +
> +echo AC_OUTPUT >>configure.in
> +
> +cat > Makefile.am << 'END'
> +EXTRA_DIST = lnk B/bbb bar1 bar2 bar3 quux
> +.PHONY: printdistdir
> +printdistdir:
> + @echo $(distdir)
> +END
> +
> +ls -l . A B
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE
> +
> +./configure
> +$MAKE distdir
> +distdir=`$MAKE printdistdir` || Exit 1

Don't try to get variables set through output from 'make', that's very
error-prone.  Instead, move this:

> +ls -l $distdir $distdir/B
> +
> +set  file lnk  A/aaa B/bbb  foo quux  foo bar1  foo bar2  foo bar3
> +while test $# -gt 0; do
> +  file=$1; shift; link=$1; shift;
> +  test -f $distdir/$link
> +  test ! -h $distdir/$link
> +  diff $file $distdir/$link
> +done

into a rule in the makefile, as is done in several other tests.
That rule can just have 'distdir' as prerequisite.

Thanks,
Ralf




Re: [PATCH 0/3] Enable `errexit' a.k.a. `set -e' shell flag in all test scripts.

2010-04-05 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 04, 2010 at 09:17:53PM CEST:
> At Sunday 04 April 2010, Ralf Wildenhues wrote:
> > Another ChangeLog style remark: please don't list all files if you
> > really adjust all files.  In that case it is sufficient to say 'All
> > tests adjusted.' or so, and only list the non-repetetive changes
> >  like for defs.in.
> Will do (and I'll surely prefer doing it this way).

If you're still writing ChangeLog entries manually, consider using
vc-chlog (packaged together with vc-dwim).

Cheers,
Ralf




Re: dist-xz compression level

2010-04-11 Thread Ralf Wildenhues
Hello Pavel,

* Pavel Sanda wrote on Wed, Apr 07, 2010 at 01:22:06PM CEST:
> the newly added dist-xz target produce worse compressed archives
> than lzma-dist. The reason is that automake call lzma with
> best compression while it won't use -9 level for xz.
> Is this intention or bug?

Bug, I guess.  I'm applying this patch to maint and merging it to
branch-1.11 and master, and adding you to THANKS.

Thanks for the report,
Ralf

Use -9 for maximum xz compression with dist-xz.

* lib/am/distdir.am (dist-xz, dist, dist-all): Pass -9 to xz.
* NEWS, THANKS: Update.
Report by Pavel Sanda.

diff --git a/NEWS b/NEWS
index a3ce191..5af2439 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Bugs fixed in 1.11.0a:
   - The `parallel-tests' test driver works around a GNU make 3.80 bug with
 trailing white space in the test list (`TESTS = foo $(EMPTY)').
 
+  - The `dist-xz' option now uses `xz -9' for maximum compression.
+
 * Long standing bugs:
 
   - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Python'
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index ec4d5e5..d88656c 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-## Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+## 2010 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -353,7 +353,7 @@ dist-lzma: distdir
 ?XZ?DIST_ARCHIVES += $(distdir).tar.xz
 .PHONY: dist-xz
 dist-xz: distdir
-   tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+   tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
$(am__remove_distdir)
 
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
@@ -397,7 +397,7 @@ dist dist-all: distdir
 ?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
 ?BZIP2?tardir=$(distdir) && $(am__tar) | bzip2 -9 -c 
>$(distdir).tar.bz2
 ?LZMA? tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-?XZ?   tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+?XZ?   tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
 ?COMPRESS? tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 ?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 ?ZIP?  -rm -f $(distdir).zip




Re: [PATCH] Check that symlinks are resolved by `make dist'.

2010-04-11 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Sun, Apr 04, 2010 at 08:57:19PM CEST:
> At Sunday 04 April 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Fri, Apr 02, 2010 at 12:29:49AM CEST:
> > > > By the way, how is the Automake-generated Makefile expected to
> > > >  behave if a file in e.g. EXTRA_DIST is a broken symlink,
> > >
> > > ... this is still not tested (I don't know what result should be
> > > expected in such a situation), and...
> > 
> > Well, what happens currently?  (I hope 'make dist' fails.)
> Yep, `make distdir' fails (and thus `make dist' fails too).

Good.

> Let's assume that a broken symlink `lnk' is added to EXTRA_DIST.
> GNU make 3.81 and 3.75 fail with:
>   make: *** No rule to make target `lnk', needed by `distdir'.  Stop.
> Heirloom make "@(#)make.sl  1.40 (gritter) 3/15/07" fails with:
>   make: fatal error: don't know how to make lnk1 (bu42)
> Debian freebsd-make (from package "freebsd-buildutils", version 7.2-1) 
> fails with:
>   make: don't know how to make lnk. Stop
> 
> However, these are not very clear error messages IMHO.

But that's something we can not easily solve in Automake.  Improving
error messages from 'make' really has to be done within 'make' itself.

> > > +distdir=`$MAKE printdistdir` || Exit 1
> > 
> > Don't try to get variables set through output from 'make', that's
> >  very error-prone.
> That was necessary with my previous "paranoid" approach, as I checked
> that `test -h' and worked correctly *for the current shell* only, not
> for the one spawned by $MAKE to execute target-associated commands.

You could have moved the test for 'test -h' into the make rule as well.
But this is moot now anyway.

> Subject: [PATCH] Check that symlinks are resolved by `make dist'.
> 
> * tests/distlinks.test: New test.
> * tests/Makefile.am (TESTS): Updated accordingly.
> Suggested by observations from Ralf Wildenhues.

This is good, thanks.  I've applied the patch with two minor changes:

> --- /dev/null
> +++ b/tests/distlinks.test

> +ln -s file lnk || {
> +  echo "$me: cannot make symlinks" >&2

I replaced this with 'cannot create symlinks to files', because that is
more accurate,

> +  Exit 77
> +}
> +

> +test: distdir
> + ls -l $(distdir) $(distdir)/B
> + fail() { echo "$(me): $$*" >&2; e=1; }; \
> + e=0; \
> + set file lnk A/aaa B/bbb foo quux foo bar1 foo bar2 foo bar3; \
> + while test $$# -gt 0; do \

and used '-ge 2' here, so the second 'shift' won't cause the shell to
barf even if I inadvertently add an odd number of arguments.

> +   file=$$1; shift; link=$(distdir)/$$1; shift; \
> +   test -f $$link || fail "$$link is not a regular file"; \
> +   test ! -h $$link || fail "$$link is a symlink"; \
> +   diff $$file $$link || fail "$$link differs from $$file"; \
> + done; \

Thanks,
Ralf




Re: [PATCH 0/3] Enable `errexit' a.k.a. `set -e' shell flag in all test scripts.

2010-04-11 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Apr 08, 2010 at 04:42:35PM CEST:
> Oops, I forgot to bump the copyright years in the modified test.
> An updated patch is attached, which also slighty improves the 
> considerations about the "safety" of the introduction of `set -e'. 

I've squashed these patches and applied them to maint.

Thanks,
Ralf




Re: [PATCH] Avoid possible false negatives in cond46.test.

2010-04-11 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Fri, Apr 09, 2010 at 02:19:32AM CEST:
> Avoid possible false negatives in cond46.test.
> 
> * tests/cond46.test: Enable shell `errexit' flag (and bumped
> copyright years).  Due to this change, the testcase should now
> fail on unexpected failures in calls to $ACLOCAL/$AUTOMAKE (whose
> outcomes were previously unchecked), and on failures in grepping
> the expected diagnostic in Automake stderr.

Thanks, applied to maint.  Please let's not get overly verbose in the
log entry.

Cheers,
Ralf




Re: [PATCH 2/2] Bugfix in confh5.test w.r.t. Solaris/Heirloom Sh.

2010-04-11 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Fri, Apr 09, 2010 at 05:11:44PM CEST:
> * tests/confh5.test: In the generated Makefile.am: do not use
> `test ! -e FILE' to check for the non-existence of a file, since
> that is not supported by Solarish/Heirloom Sh.

Applied to maint.

Thanks!
Ralf




Re: [PATCH 1/2] Use `set -e' in confsub.test (avoid false negatives).

2010-04-11 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Fri, Apr 09, 2010 at 07:25:31PM CEST:
> -$ACLOCAL || Exit 1
> -$AUTOMAKE || Exit 1
> +$ACLOCAL
> +$AUTOMAKE

there is no need to actually remove these.  They may not be strictly
required any more with 'set -e', but they may still serve as visual
reminder that this is an important part of the test.

Cheers,
Ralf




Fix per-Makefile.am setting of -Werror.

2010-04-11 Thread Ralf Wildenhues
Setting -Werror in a Makefile.am affects the handling of Makefile.am
files treated later by the same automake process (more precisely, the
same thread):

sub/Makefile.am:
AUTOMAKE_OPTIONS = -Werror
# no warnings happen in this file

Makefile.am:
AUTOMAKE_OPTIONS = -Wall
# redefined variable warning
VAR = 1
VAR = 2

AUTOMAKE_JOBS=2 automake  # zero exit status
unset AUTOMAKE_JOBS; automake # nonzero
automake Makefile # zero because we see no -Werror

I'm pushing this fix to maint, for master and branch-1.11.

Thanks,
Ralf

Fix per-Makefile.am setting of -Werror.

Before this patch, 'AUTOMAKE_OPTIONS = -Werror' in one
Makefile.am would carry over to other Makefile.am files
treated afterwards by the same thread, causing inconsistent
and unstable exit status values.

* lib/Automake/Channels.pm (dup_channel_setup)
(drop_channel_setup): Save and restore the setting of
$warnings_are_errors.
* tests/werror3.test: New test.
* tests/Makefile.am: Adjust.
* NEWS: Update.

diff --git a/NEWS b/NEWS
index 5af2439..fee7f83 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ Bugs fixed in 1.11.0a:
   - Several scripts as well as the parallel-tests testsuite driver now
 exit with the right exit status upon receiving a signal.
 
+  - A per-Makefile.am setting of -Werror does not carry over to the
+handling of other Makefile.am files any more.
 
 New in 1.11:
 
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index 223d8d2..050ba05 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -710,8 +710,9 @@ entry, while C just deletes it.
 
 =cut
 
-use vars qw (@_saved_channels);
+use vars qw (@_saved_channels @_saved_werrors);
 @_saved_channels = ();
+...@_saved_werrors = ();
 
 sub dup_channel_setup ()
 {
@@ -721,12 +722,14 @@ sub dup_channel_setup ()
   $channels_copy{$k1} = {%{$channels{$k1}}};
 }
   push @_saved_channels, \%channels_copy;
+  push @_saved_werrors, $warnings_are_errors;
 }
 
 sub drop_channel_setup ()
 {
   my $saved = pop @_saved_channels;
   %channels = %$saved;
+  $warnings_are_errors = pop @_saved_werrors;
 }
 
 =item C, C
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7e14b1c..eb63337 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -746,6 +746,7 @@ vtexi2.test \
 warnopts.test \
 werror.test \
 werror2.test \
+werror3.test \
 whoami.test \
 xsource.test \
 xz.test \
diff --git a/tests/werror3.test b/tests/werror3.test
new file mode 100755
index 000..96b4ff3
--- /dev/null
+++ b/tests/werror3.test
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2010  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Make sure a per-Makefile.am -Werror setting is not carried over
+# to another Makefile.am.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir sub
+cat >sub/Makefile.am <<\END
+AUTOMAKE_OPTIONS = -Werror
+END
+cat >Makefile.am <<\END
+VAR = foo
+VAR = bar
+END
+
+$ACLOCAL
+
+# The issue would not manifest with threaded execution.
+unset AUTOMAKE_JOBS || :
+AUTOMAKE_run 0 -Wno-error
+grep 'VAR multiply defined' stderr
+
+AUTOMAKE_JOBS=2
+export AUTOMAKE_JOBS
+AUTOMAKE_run 0 -Wno-error
+grep 'VAR multiply defined' stderr
+:




Re: [PATCH] Avoid possible false negatives in cond46.test.

2010-04-11 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 11, 2010 at 09:04:55PM CEST:
> At Sunday 11 April 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Fri, Apr 09, 2010 at 02:19:32AM CEST:
> > > Avoid possible false negatives in cond46.test.
> > >
> > > * tests/cond46.test: Enable shell `errexit' flag (and bumped
> > > copyright years).  Due to this change, the testcase should now
> > > fail on unexpected failures in calls to $ACLOCAL/$AUTOMAKE (whose
> > > outcomes were previously unchecked), and on failures in grepping
> > > the expected diagnostic in Automake stderr.
> > 
> > Thanks, applied to maint.  Please let's not get overly verbose in
> >  the log entry.
> > 
> How'd you suggest to shorten the log entry above, while keeping it 
> meaningful?

By cutting the part which I did not quote.  :-)

Being verbose is fine for things that are unobvious, but you may assume
that developers know autoconf.info.

> However, if you think that high terseness is better than high
> verbosity, I could aim for the former when in doubt.

Not in general, but ChangeLog normally document what changed; why
something changed should usually be done in the actual code, if that is
necessary.  I sometimes add short rationale explanations to the log if
the change is otherwise not easily understood.  For this particular
patch, however, no explanation is necessary, because it is self-evident
when looking at the file that changed.

Anyway, this isn't all that crucial one way or the other.

Cheers,
Ralf




Re: dist-xz compression level

2010-04-11 Thread Ralf Wildenhues
Hello Andreas,

* Andreas Jellinghaus wrote on Sun, Apr 11, 2010 at 09:37:13PM CEST:
> isn't xz extremely slw with -9?
> maybe it wasn't a bug, bit intentionally not used,
> as that huge extra amount of time doesn't result in
> that many bytes saved.

Well, does somebody have numbers (memory, time, compression) as to what
is reasonable?

> is the compression level configureable somehow?

Not ATM, but if necessary we could change that.

Thanks,
Ralf




[PATCH 0/5] Prepend 'error: ' or 'warning: ' to messages.

2010-04-11 Thread Ralf Wildenhues
Hello Bruno, all,

I'm sure it was you who requested this feature, but I can't find the
reference to this issue now.  Anyway, here's a small patch series to
let automake and aclocal consistenly prefix warning and error messages,
applied to git master.

I wasn't completely sure about the case of warnings in the presence
of -Werror.  I dislike something like
  error (was warning):

because that will make lines even longer than what we have already.
Instead, we print a note stating
  warnings are treated as errors

and then continue to prepend them with 'warning: '.  I see that while
old GCC versions do exactly that, newer ones changed the prefix to be
'error: ' instead.  Not sure whether that was done on purpose, it may
just be a (very minor, of course) GCC regression.

For per-Makefile.am -Werror settings, we could make the "warnings are
treated as errors" message produce the line where -Werror was set; not
sure if that is all that helpful though.

Thanks,
Ralf




[PATCH 1/5] Fix connected warnings about obsolete exeext override.

2010-04-11 Thread Ralf Wildenhues
* lib/Automake/Rule.pm (define): Merge two warnings that belong
together, by setting the 'partial' flag for the first one.

Signed-off-by: Ralf Wildenhues 
---

This is just a preparation patch, so we don't prepend the second part of
the message.

Cheers,
Ralf

 ChangeLog|4 
 lib/Automake/Rule.pm |6 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 19b7772..9a0b332 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-11  Ralf Wildenhues  
 
+   Fix connected warnings about obsolete exeext override.
+   * lib/Automake/Rule.pm (define): Merge two warnings that belong
+   together, by setting the 'partial' flag for the first one.
+
Fix per-Makefile.am setting of -Werror.
Before this patch, 'AUTOMAKE_OPTIONS = -Werror' in one
Makefile.am would carry over to other Makefile.am files
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 68b3ea5..d7e7105 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2007, 2010  Free Software Foundation,
+# Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -615,7 +616,8 @@ sub define ($)
  msg ('obsolete', $tdef->location,
   "deprecated feature: target `$noexe' overrides "
   . "`$noexe\$(EXEEXT)'\n"
-  . "change your target to read `$noexe\$(EXEEXT)'");
+  . "change your target to read `$noexe\$(EXEEXT)'",
+  partial => 1);
  msg ('obsolete', $where, "target `$target' was defined here");
}
   # Don't `return ()' now, as this might hide target clashes
-- 
1.7.0.rc1.161.g90487





[PATCH 2/5] Fix capitalization of error messages, reword one message.

2010-04-11 Thread Ralf Wildenhues
* lib/Automake/Variable.pm (define): Do not capitalize the first
word in the error message.
* automake.in (require_file_internal): Likewise.  Also, reword
and line-wrap for better readability.
* tests/distcom7.test, tests/pluseq5.test, tests/pluseq9.test:
Adjust tests.

Signed-off-by: Ralf Wildenhues 
---

A bit better GCS compliance.

Cheers,
Ralf

 ChangeLog|8 
 automake.in  |5 +++--
 lib/Automake/Variable.pm |4 ++--
 tests/distcom7.test  |4 ++--
 tests/pluseq5.test   |7 ---
 tests/pluseq9.test   |6 +++---
 6 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a0b332..6ed3c6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-04-11  Ralf Wildenhues  
 
+   Fix capitalization of error messages, reword one message.
+   * lib/Automake/Variable.pm (define): Do not capitalize the first
+   word in the error message.
+   * automake.in (require_file_internal): Likewise.  Also, reword
+   and line-wrap for better readability.
+   * tests/distcom7.test, tests/pluseq5.test, tests/pluseq9.test:
+   Adjust tests.
+
Fix connected warnings about obsolete exeext override.
* lib/Automake/Rule.pm (define): Merge two warnings that belong
together, by setting the 'partial' flag for the first one.
diff --git a/automake.in b/automake.in
index d5e3ec2..4a753db 100644
--- a/automake.in
+++ b/automake.in
@@ -7914,8 +7914,9 @@ sub require_file_internal ($$$@)
  # the top level Makefile.  Furthermore Automake
  # hasn't been asked to create the Makefile.in
  # that distributes the aux dir files.
- error ($where, 'Please make a full run of automake'
-. " so $fullfile gets distributed.");
+ error ($where, 'please rerun automake without '
+. "Makefile arguments\n"
+. "so $fullfile gets distributed.");
}
}
}
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index c340dc7..bf44c38 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -996,10 +996,10 @@ sub define ()
  if (! $undef_cond->false)
{
  error ($where,
-"Cannot apply `+=' because `$var' is not defined "
+"cannot apply `+=' because `$var' is not defined "
 . "in\nthe following conditions:\n  "
 . join ("\n  ", map { $_->human } $undef_cond->conds)
-. "\nEither define `$var' in these conditions,"
+. "\neither define `$var' in these conditions,"
 . " or use\n`+=' in the same conditions as"
 . " the definitions.");
}
diff --git a/tests/distcom7.test b/tests/distcom7.test
index 500c909..646275c 100755
--- a/tests/distcom7.test
+++ b/tests/distcom7.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2009, 2010  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -38,4 +38,4 @@ echo bin_PROGRAMS = foo > subdir/Makefile.am
 
 $ACLOCAL
 AUTOMAKE_fails --add-missing subdir/Makefile
-grep 'full run' stderr
+grep 'without.*Makefile.*arguments' stderr
diff --git a/tests/pluseq5.test b/tests/pluseq5.test
index 1f1c98c..5efe34e 100755
--- a/tests/pluseq5.test
+++ b/tests/pluseq5.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2010  Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,10 +35,10 @@ AUTOMAKE_fails
 
 # We expect the following diagnostic:
 #
-# Makefile.am:4: Cannot apply `+=' because `INCLUDES' is not defined in
+# Makefile.am:4: cannot apply `+=' because `INCLUDES' is not defined in
 # Makefile.am:4: the following conditions:
 # Makefile.am:4:   !CHECK
-# Makefile.am:4: Either define `INCLUDES' in these conditions, or use
+# Makefile.am:4: either define `INCLUDES' in these conditions, or use
 # Makefile.am:4: `+=' in the same conditions as the definitions.
 
 # Is !CHECK mentioned?
diff --git a/tests/pluseq9.test b/tests/pluseq9.test
index 31e1c8d..b7d6643 100755
--- a/tests/pluseq9.test
+++ b/tests/pluseq9.test
@@ -1,5 +1,5 @

[PATCH 3/5] Prepend type to warning, error, and fatal messages.

2010-04-11 Thread Ralf Wildenhues
For the first part of messages of types `error' or `fatal',
prepend `error: ' to the message.  Prepend `warning: ' to
warning messages, whatever the setting of -Werror.

* lib/Automake/Channels.pm (partial): Move up definition.
(_format_message): Emit `header' and `footer' strings only with
the first resp. last part of a set of partial messages.
* lib/Automake/ChannelDefs.pm: Add missing '1;' statement at the
end of the module.
(Automake::ChannelDefs): Setup warning channels with header
`warning: ', error and fatal messages with header `error: '.
* tests/condinc2.test, tests/ltinstloc.test: Adjust expected
error messages.
* tests/comment5.test: Likewise.  Also, include stack notes
should not start with `error:'.
* tests/location.test: Likewise.  Also, try both -Werror and
-Wno-error.
* NEWS: Update.
Report by Bruno Haible.

Signed-off-by: Ralf Wildenhues 
---

This is the meat of the series.  There are probably some warnings
where we can improve word wrapping afterwards.

Cheers,
Ralf

 ChangeLog   |   20 
 NEWS|3 +++
 lib/Automake/ChannelDefs.pm |6 ++
 lib/Automake/Channels.pm|   21 -
 tests/comment5.test |9 +
 tests/condinc2.test |6 +++---
 tests/location.test |   21 +
 tests/ltinstloc.test|6 +++---
 8 files changed, 65 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6ed3c6f..65a637d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2010-04-11  Ralf Wildenhues  
 
+   Prepend type to warning, error, and fatal messages.
+   For the first part of messages of types `error' or `fatal',
+   prepend `error: ' to the message.  Prepend `warning: ' to
+   warning messages, whatever the setting of -Werror.
+   * lib/Automake/Channels.pm (partial): Move up definition.
+   (_format_message): Emit `header' and `footer' strings only with
+   the first resp. last part of a set of partial messages.
+   * lib/Automake/ChannelDefs.pm: Add missing '1;' statement at the
+   end of the module.
+   (Automake::ChannelDefs): Setup warning channels with header
+   `warning: ', error and fatal messages with header `error: '.
+   * tests/condinc2.test, tests/ltinstloc.test: Adjust expected
+   error messages.
+   * tests/comment5.test: Likewise.  Also, include stack notes
+   should not start with `error:'.
+   * tests/location.test: Likewise.  Also, try both -Werror and
+   -Wno-error.
+   * NEWS: Update.
+   Report by Bruno Haible.
+
Fix capitalization of error messages, reword one message.
* lib/Automake/Variable.pm (define): Do not capitalize the first
word in the error message.
diff --git a/NEWS b/NEWS
index 74887fb..5d167bb 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,9 @@ New in 1.11a:
 
   - "make dist" can now create lzip-compressed tarballs.
 
+  - Messages of types warning or error from `automake' and `aclocal' are now
+prefixed with the respective type.
+
 Bugs fixed in 1.11a:
 
   - Lots of minor bugfixes.
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index ce6bf29..26ef575 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -163,6 +163,10 @@ register_channel 'verb', type => 'debug', silent => 1, 
uniq_part => UP_NONE,
   ordered => 0;
 register_channel 'note', type => 'debug', silent => 0;
 
+setup_channel_type 'warning', header => 'warning: ';
+setup_channel_type 'error', header => 'error: ';
+setup_channel_type 'fatal', header => 'error: ';
+
 =head2 FUNCTIONS
 
 =over 4
@@ -381,6 +385,8 @@ Written by Alexandre Duret-Lutz EFE.
 
 =cut
 
+1;
+
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
 ## perl-indent-level: 2
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index 050ba05..b08b90d 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -204,10 +204,14 @@ C, and C constants above.
 =item C ''>
 
 A string to prepend to each message emitted through this channel.
+With partial messages, only the first part will have C
+prepended.
 
 =item C ''>
 
 A string to append to each message emitted through this channel.
+With partial messages, only the final part will have C
+appended.
 
 =item C 0>
 
@@ -399,20 +403,24 @@ sub _format_sub_message ($$)
   return $leader . join ("\n" . $leader, split ("\n", $message)) . "\n";
 }
 
+# Store partial messages here. (See the 'partial' option.)
+use vars qw ($partial);
+$partial = '';
+
 # _format_message ($LOCATION, $MESSAGE, 

[PATCH 4/5] Ensure we don't print 'warning:' or 'error:' twice.

2010-04-11 Thread Ralf Wildenhues
* Makefile.am (sc_ensure_testsuite_has_run): New helper rule.
(sc_tests_logs_duplicate_prefixes): New rule, to check for
wrong-looking warning and error messages in the test suite logs.
* aclocal.in (scan_configure_dep, scan_file): Remove duplicate
`warning: ' prefix.
* tests/vars3.test: Rename variable to avoid false positive.

Signed-off-by: Ralf Wildenhues 
---

I didn't want to let the sc_tests_logs_duplicate_prefixes rule depend
upon 'check' because that would make 'maintainer-check' very expensive.
Introducing a toplevel GNUmakefile, we could safely use 'make check
RECHECK_LOGS=', but for now it's fine to just require a test-suite.log
file to be present.


 ChangeLog|8 
 Makefile.am  |   19 +++
 Makefile.in  |   14 ++
 aclocal.in   |6 +++---
 tests/vars3.test |6 +++---
 5 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 65a637d..f63d2a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-04-11  Ralf Wildenhues  
 
+   Ensure we don't print 'warning:' or 'error:' twice.
+   * Makefile.am (sc_ensure_testsuite_has_run): New helper rule.
+   (sc_tests_logs_duplicate_prefixes): New rule, to check for
+   wrong-looking warning and error messages in the test suite logs.
+   * aclocal.in (scan_configure_dep, scan_file): Remove duplicate
+   `warning: ' prefix.
+   * tests/vars3.test: Rename variable to avoid false positive.
+
Prepend type to warning, error, and fatal messages.
For the first part of messages of types `error' or `fatal',
prepend `error: ' to the message.  Prepend `warning: ' to
diff --git a/Makefile.am b/Makefile.am
index 6c24285..f5ab44f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -190,6 +190,7 @@ sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
+sc_tests_logs_duplicate_prefixes \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -458,6 +459,24 @@ sc_tests_plain_egrep_fgrep:
  exit 1; \
fi
 
+## Rule to ensure that the testsuite has been run before.  We don't depend on 
`check'
+## here, because that would be very wasteful in the common case.  We could run
+## `make check RECHECK_LOGS=' and avoid toplevel races with 
AM_RECURSIVE_TARGETS.
+sc_ensure_testsuite_has_run:
+   @if test ! -f tests/test-suite.log; then \
+ echo "Run \`make check' before \`maintainer-check'" >&2; \
+ exit 1; \
+   fi
+.PHONY: sc_ensure_testsuite_has_run
+
+## Ensure our warning and error messages do not contain duplicate 'warning:' 
prefixes.
+## This test actually depends on the testsuite having been run before; but it 
would be
+sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
+   @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
+ echo 'Duplicate warning/error message prefixes seen in above tests.' 
>&2; \
+ exit 1; \
+   fi
+
 sc_mkdir_p:
@if grep 'mkdir_p' $(srcdir)/automake.in \
  $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
diff --git a/Makefile.in b/Makefile.in
index d8e60c0..15d81ba 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -312,6 +312,7 @@ sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
+sc_tests_logs_duplicate_prefixes \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -1180,6 +1181,19 @@ sc_tests_plain_egrep_fgrep:
  exit 1; \
fi
 
+sc_ensure_testsuite_has_run:
+   @if test ! -f tests/test-suite.log; then \
+ echo "Run \`make check' before \`maintainer-check'" >&2; \
+ exit 1; \
+   fi
+.PHONY: sc_ensure_testsuite_has_run
+
+sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
+   @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
+ echo 'Duplicate warning/error message prefixes seen in above tests.' 
>&2; \
+ exit 1; \
+   fi
+
 sc_mkdir_p:
@if grep 'mkdir_p' $(srcdir)/automake.in \
  $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
diff --git a/aclocal.in b/aclocal.in
index dc84762..9622711 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -435,7 +435,7 @@ sub scan_configure_dep ($)
  # Make this just a warning, because we do not know whether
  # the macro is actually used (it could be called conditionally).
  msg ('unsupported', "$file:$line",
-  "warning: macro `$2' not found in library");
+  "macro `$2' not found in library");
}
 }
 
@@ -507,7 +507,7 @@ sub scan_file (

[PATCH 5/5] Print 'warnings are treated as errors' note if needed.

2010-04-11 Thread Ralf Wildenhues
* lib/Automake/Channels.pm: Fix typo in comment.
(_print_message): If -Werror is enabled, print a 'warnings are
treated as errors' note before the first such warning.
* tests/warnopts.test: Adjust comment to mention expected warning.
Adjust code to ignore 'warnings are treated as errors' note.
* tests/location.test: Adjust expected output with -Werror.
* tests/werror4.test: New test.
* tests/Makefile.am: Update.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues 
---
 ChangeLog|   11 +++
 NEWS |2 +-
 lib/Automake/Channels.pm |5 +++-
 tests/Makefile.am|1 +
 tests/Makefile.in|1 +
 tests/location.test  |3 +-
 tests/warnopts.test  |9 +++---
 tests/werror4.test   |   68 ++
 8 files changed, 93 insertions(+), 7 deletions(-)
 create mode 100755 tests/werror4.test

diff --git a/ChangeLog b/ChangeLog
index f63d2a5..d7f3c23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-04-11  Ralf Wildenhues  
 
+   Print 'warnings are treated as errors' note if needed.
+   * lib/Automake/Channels.pm: Fix typo in comment.
+   (_print_message): If -Werror is enabled, print a 'warnings are
+   treated as errors' note before the first such warning.
+   * tests/warnopts.test: Adjust comment to mention expected warning.
+   Adjust code to ignore 'warnings are treated as errors' note.
+   * tests/location.test: Adjust expected output with -Werror.
+   * tests/werror4.test: New test.
+   * tests/Makefile.am: Update.
+   * NEWS: Update.
+
Ensure we don't print 'warning:' or 'error:' twice.
* Makefile.am (sc_ensure_testsuite_has_run): New helper rule.
(sc_tests_logs_duplicate_prefixes): New rule, to check for
diff --git a/NEWS b/NEWS
index 5d167bb..13b28c0 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ New in 1.11a:
   - "make dist" can now create lzip-compressed tarballs.
 
   - Messages of types warning or error from `automake' and `aclocal' are now
-prefixed with the respective type.
+prefixed with the respective type, and presence of -Werror is noted.
 
 Bugs fixed in 1.11a:
 
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index b08b90d..35897a5 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -164,7 +164,7 @@ functions.  The possible keys, with their default value are:
 The type of the channel.  One of C<'debug'>, C<'warning'>, C<'error'>, or
 C<'fatal'>.  Fatal messages abort the program when they are output.
 Error messages update the exit status.  Debug and warning messages are
-harmless, except that warnings can be treated as errors of
+harmless, except that warnings are treated as errors if
 C<$warnings_are_errors> is set.
 
 =item C 1>
@@ -514,6 +514,9 @@ sub _print_message ($$%)
   $partial = '';
 }
 
+  msg ('note', '', 'warnings are treated as errors', uniq_scope => US_GLOBAL)
+if ($opts{'type'} eq 'warning' && $warnings_are_errors);
+
   # Check for duplicate message if requested.
   my $to_filter;
   if ($opts{'uniq_part'} ne UP_NONE)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f51ebd7..2255af6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -763,6 +763,7 @@ warnopts.test \
 werror.test \
 werror2.test \
 werror3.test \
+werror4.test \
 whoami.test \
 xsource.test \
 xz.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 387af70..beb1ac9 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1003,6 +1003,7 @@ warnopts.test \
 werror.test \
 werror2.test \
 werror3.test \
+werror4.test \
 whoami.test \
 xsource.test \
 xz.test \
diff --git a/tests/location.test b/tests/location.test
index ced9952..21cfb4e 100755
--- a/tests/location.test
+++ b/tests/location.test
@@ -74,5 +74,6 @@ diff expected observed || Exit 1
 
 AUTOMAKE_fails -Werror
 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
-diff expected observed || Exit 1
+( echo 'automake: warnings are treated as errors'; cat expected ) \
+  | diff - observed || Exit 1
 :
diff --git a/tests/warnopts.test b/tests/warnopts.test
index 6d96400..b472164 100755
--- a/tests/warnopts.test
+++ b/tests/warnopts.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2010  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -46,14 +46,15 @@ END
 $ACLOCAL
 AUTOMAKE_fails
 # The expected diagnostic is
-#   Makefile.am:3: unused variable: `foo_SOURCES'
-#   sub/Makefile.am:2: `INCLUDES' is the old 

Re: [PATCH] Avoid possible false negatives in cond46.test.

2010-04-11 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 11, 2010 at 10:30:19PM CEST:
> At Sunday 11 April 2010, Ralf Wildenhues wrote:
> > Being verbose is fine for things that are unobvious, but you may
> >  assume that developers know autoconf.info.
> Quite right.  However, as you said when discussing my proposed patch 
> enabling `set -e' in all test scripts, the behaviour of the `errexit' 
> shell flag can vary wildly among different shells in unusual situations, 
> and is generally quite bug-prone when control structures or complex 
> commands are involved.  The more detailed analysis contained in the 
> git commit message tried to show (by static code inspection only) that 
> no bug should have cropped up in the test case in question.  However, 
> if you deem that such an analysis is not required, I'll be happy to 
> oblige in future similar patches.  Really happy indeed ;-)

The analysis is required in any case.  That doesn't mean it is necessary
to mention it in the log message; because even if the analysis is hard
work, in this case it is straight-forward.  IOW, the size of the log
message doesn't have to reflect the amount of work done for the patch.

If you feel your work needs more representation, that can be done by
different means.

Cheers,
Ralf




Re: Some warnings of type `unsupported' don't cause "automake -Werror" to fail

2010-04-19 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 18, 2010 at 06:17:29PM CEST:
> Recently, I stumbled upon a weird behaviour of automake: apparently,
> even when given the `-Werror' flag, it doesn't fail on warnings of type 
> `unsupported' which concern the copresence of `configure.ac' and 
> `configure.in'.

Thanks for the bug report.  This happens because find_configure_ac is
called at the time the Variable.pm module is initialized, which is
before the command line options have been parsed and acted upon.

I'm applying this fix.

Thanks,
Ralf

Fix -Werror handling for presence of configure.in and configure.ac.

* lib/Automake/Variable.pm (Automake::Variable): Do not initialize
$configure_ac at the global level, before command-line arguments
have been parsed.
(require_variables): Initialize it here.
* tests/configure.test: New test.
* tests/Makefile.am: Update.
Report by Stefano Lattarini.

diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 250dee9..fa30585 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -195,7 +195,7 @@ my %_ac_macro_for_var =
);
 
 # The name of the configure.ac file.
-my $configure_ac = find_configure_ac;
+my $configure_ac;
 
 # Variables that can be overridden without complaint from -Woverride
 my %_silent_variable_override =
@@ -1134,6 +1134,9 @@ sub require_variables ($$$@)
   my $res = 0;
   $reason .= ' but ' unless $reason eq '';
 
+  $configure_ac = find_configure_ac
+unless defined $configure_ac;
+
  VARIABLE:
   foreach my $var (@vars)
 {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7dc1088..815740f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -218,6 +218,7 @@ condinc2.test \
 condlib.test \
 condman.test \
 condman2.test \
+configure.test \
 conf2.test \
 confdeps.test \
 conff.test \
diff --git a/tests/configure.test b/tests/configure.test
new file mode 100755
index 000..57a5fab
--- /dev/null
+++ b/tests/configure.test
@@ -0,0 +1,51 @@
+#! /bin/sh
+# Copyright (C) 2010  Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Diagnose if both configure.in and configure.ac are present, prefer
+# configure.ac.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >configure.ac <<\EOF
+AC_INIT
+AM_INIT_AUTOMAKE([configure], [1.0])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+EOF
+
+: >Makefile.am
+
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'configure.ac.*configure.in.*both present' stderr
+
+$ACLOCAL -Wno-error 2>stderr
+cat stderr >&2
+grep 'configure.ac.*configure.in.*both present' stderr
+grep 'proceeding.*configure.ac' stderr
+
+# Ensure we really proceed with configure.ac.
+AUTOMAKE_fails -Werror
+grep 'configure.ac.*configure.in.*both present' stderr
+grep 'proceeding.*configure.ac' stderr
+
+AUTOMAKE_run 0 -Wno-error
+grep 'configure.ac.*configure.in.*both present' stderr
+grep 'proceeding.*configure.ac' stderr
+
+:




Re: [PATCH 2/2] Bugfix in confh5.test w.r.t. Solaris/Heirloom Sh.

2010-04-19 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sat, Apr 17, 2010 at 03:56:05PM CEST:
> At Sunday 11 April 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Fri, Apr 09, 2010 at 05:11:44PM CEST:
> > > * tests/confh5.test: In the generated Makefile.am: do not use
> > > `test ! -e FILE' to check for the non-existence of a file, since
> > > that is not supported by Solarish/Heirloom Sh.
> > 
> > Applied to maint.
> > 
> Oops, it seems that the ChangeLog entry was somehow botched during the 
> patch application.  This should fix it.

Thanks.  This and newer patches of yours should all be applied now.
Please speak up if I've overlooked any again.

Thanks,
Ralf




pending patches (was: [PATCH 2/2] Bugfix in confh5.test w.r.t. Solaris/Heirloom Sh.)

2010-04-20 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Tue, Apr 20, 2010 at 12:14:51PM CEST:
> At Tuesday 20 April 2010, Ralf Wildenhues wrote:
> > Thanks.  This and newer patches of yours should all be applied now.
> > Please speak up if I've overlooked any again.
> I guess that you're talking about overlooked typos/mistakes, not 
> "overlooked" patches, right? 

Right.

> In fact, I'm assuming that you haven't 
> answered the the recent still-pending patches' proposals basically for 
> lack of time;

Right.  Those where I've merged your patches looked all fine to me.
Sorry if that looked as if I wasn't honoring them properly.

> and assuming this, I avoid to send you ping messages, 
> which would be just annoying in this situation.  But if you think you 
> might have overlooked some messages/patches of mine, I could send 
> proper pings (which would be useful in this situation).

Well I know I've avoided the zsh patch set and the run_command and
check-testsuite stuff.  Other than that, with respect to stuff older
than today, I now see that I haven't addressed the distlinksbrk.test
and an instspc.test fix for Solaris sh.
 
> That said, yes, there is still a typo in the ChangeLog, and that was a 
> mistake of mine (I have it in my private git branch too). The attached 
> patch should fix it.

Thanks, I'm applying that.

> Sorry for this additional noise.

Don't worry.  My Delete key is very quick. ;-)

Cheers,
Ralf

> From 6516fd39c3c92f1a7d66906adbaf89fb3a99ede5 Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Tue, 20 Apr 2010 11:26:28 +0200
> Subject: [PATCH] Typofix in older changelog entry.




Re: Use `set -e' in confsub.test (avoid false negatives).

2010-04-20 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Apr 20, 2010 at 12:22:48PM CEST:
> Mmhh... I thought that you had already applied this patch, but 
> perusing the git logs of latest master I saw that this is not the 
> case.
> 
> Thus I rebased the patches and amended them to follow your
> suggestions.  The new patches are attached.

Thanks.  I'm applying 1/2 but not 2/2, I don't see the advantage in
changes that are noise.

>  PATCH [1/2]  Use `set -e' in confsub.test (avoid false negatives).
> 
>   * tests/confsub.test: Enable shell `errexit' flag, and related
> changes (this helps avoiding some possible minor false negatives).
> Also, bumped copyright years.

>  [PATCH 2/2] Some cleanup and cosmetic changes in confsub.test.
> 
>   * tests/confsub.test: Prefer `echo' over `cat' to create one-line
> data files, and prefer `:' over `cat' to create empty data files.

Cheers,
Ralf




Re: Some warnings of type `unsupported' don't cause "automake -Werror" to fail

2010-04-20 Thread Ralf Wildenhues
[ let's drop bug-automake ]

* Stefano Lattarini wrote on Tue, Apr 20, 2010 at 12:55:36PM CEST:
> At Tuesday 20 April 2010, Ralf Wildenhues wrote:
> > 
> > I'm applying this fix.
> > ...
> > * tests/configure.test: New test.
> > ...
> OK, I'm a dope...  I found the bug while trying to write a test script 
> for the copresence of configure.{in,ac}, but then I didn't include that 
> script in the bug report -- which would have made the report better, 
> and saved yourself the work of writing a new testcase from scratch.
> Sigh.
> 
> Oh well, attached here is my original test script (which is IMHO 
> slighty stricter and more comprehensive than yours in some respects).  
> Maybe you can find it useful.

AFAICS, your test doesn't ensure that without -Werror turned on,
automake actually suceeds when both configure.ac and configure.in are
present.

OTOH, actually ensuring that configure.ac is used seems like a good
idea.  I'm amending the test in your name as follows, hope you don't
mind.

> Thanks for your fix (and sorry for my sloppiness),

No worries.  I didn't put you in as co-author of the original patch as
preemptive punishment.  ;-)

Cheers,
Ralf

2010-04-20  Stefano Lattarini  

Make test for configure.in vs. configure.ac stricter.
* tests/configure.test: Use a configure.in file that provokes
an automake error, to ensure configure.ac is preferred.

diff --git a/tests/configure.test b/tests/configure.test
index 4b0f28d..50a034f 100755
--- a/tests/configure.test
+++ b/tests/configure.test
@@ -28,6 +28,13 @@ AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 EOF
 
+cat >configure.in <Makefile.am
 
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }




Re: [PATCH] Make badopt.test stricter (by enabling `set -e').

2010-04-20 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Wed, Apr 21, 2010 at 12:04:51AM CEST:
> Another simple patch aimed at making the Automake test scripts use 
> `set -e' more consistently.

Can we merge this patch with all others that are still to come and set
-e on tests?

Thanks,
Ralf




Re: [PATCH] Make badopt.test stricter (by enabling `set -e').

2010-04-25 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Wed, Apr 21, 2010 at 01:59:51PM CEST:
> In fact, I'm inclined to keep the patches enabling `set -e' separated
> for three reasons:
> 
>   1. To make the analysis of these patches simpler (as they are very
>   short); this should tendentially lead to more accurate reviews --
>   which is very important for the kind of changes introduced by the
>   patches, because, as you pointed out in a previous thread, the
>   `errexit' shell flag is particularly prone to portability problems
>   and bugs.
> 
>   2. To make it easy for you to reject changes deemed unworthy,
>   dubious or dangerous, and to make it easier for me to amend
>   changes (if required).

> However, I could at least clump the changes in bigger lumps (say a 
> dozen of files modified togheter), if you still think this would be more 
> convenient.  WDYT?

Yes, that would be better, because it would lower the per-patch effort.
Thanks.

>   3. So that the changes can be done incrementally, maybe even on
>   an extended time period (which should alleviate the "not enough
>   time for the review" problem).

For what it's worth, since git this issue should be fairly moot.
You can keep branches for a long time, and merge them into your
devel-branch-du-jour for testing them.  You can squash stuff into
them.  You can rebase them if you think that would help you, but
frankly, don't.  Just keep the patch from where you developed it,
unless it requires newer stuff.  When that happens, you can either
rebase, or merge maint (or whatever else newer you need) into your
branch and continue.  Only then, you would need to start publishing
trees or git bundles, so that merges are handled upstream.

Cheers,
Ralf




Re: [QUESTION] cscope.test

2010-04-25 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Fri, Apr 23, 2010 at 07:23:03PM CEST:
> Myabe this is a stupid question, but I've not been not able to figure
> out what's the role of the following trailing lines in `cscope.test':
> 
>   $MAKE || Exit 77

This line was added in a1d5239b5e to cope with absent Fortran compiler.

>   $MAKE distclean

This is just cleanup for the following, I guess.

>   cd ..
>   ./configure
>   $MAKE distcheck
>   
>   :
> 
> What are they supposed to test?

Probably I just added the distcheck merely to ensure that the rules for
the generated sources in sub/Makefile.am are consistent.  I tend to add
them while writing a test, to ensure the Makefile.am files are complete
and fairly copy-pasteable.  No big issue either way here though.

Cheers,
Ralf




Re: [PATCH 5/5] Improved test silent5.test.

2010-04-25 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, Apr 22, 2010 at 10:31:24PM CEST:
> Subject: [PATCH 5/5] Improved test silent5.test.
> 
> * tests/silent5.test: Removed by hand all generated C files after
> non-verbose builds, to ensure the following builds are clean.
> A couple of greps of make's output have been made stricter.
> Extended test description telling it's fine if it overlaps a bit
> with other `silent*.test' tests.

> --- a/tests/silent5.test
> +++ b/tests/silent5.test

> @@ -116,7 +119,7 @@ do
>$MAKE >stdout || { cat stdout; Exit 1; }
>cat stdout
>grep ' -c' stdout && Exit 1
> -  grep ' -o ' stdout && Exit 1
> +  grep ' -o' stdout && Exit 1

This test has become less instead of more strict; oversight or purpose?

>grep mv stdout && Exit 1
>  
>grep 'CXX .*foo1\.' stdout
> @@ -139,10 +142,13 @@ do
>grep 'CXXLD .*baz' stdout
>grep 'CCLD .*bla' stdout
>  
> +  # Ensure a clean rebuild.
>$MAKE clean
> +  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]

Hmm, I wonder if doing clean and rebuild with the same V flag (and
without removing generated sources in between) would be a sensible
addition on top of this: it might trigger a different set of rules
(as I think you may be able to see with heirloom make).

>$MAKE V=1 >stdout || { cat stdout; Exit 1; }
>cat stdout
> -  grep ' -c' stdout
> +  grep ' -c ' stdout
>grep ' -o ' stdout
>  
>grep 'CXX .*foo1\.' stdout && Exit 1
> @@ -164,8 +170,12 @@ do
>grep 'CCLD .*bar' stdout && Exit 1
>grep 'CXXLD .*baz' stdout && Exit 1
>grep 'CCLD .*bla' stdout && Exit 1
> +
> +  # Ensure a clean reconfiguration/rebuild.
>$MAKE clean
>$MAKE maintainer-clean
> +  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]

Wait, maintainer-clean should have removed all these files at this
point (and some of the other lex/yacc tests should have this tested,
too).  Does that not work for you?

Other than the above nits, this series looks fairly good to me.  You
could add something like 'Split out from silent5.test' to the test
descriptions, but that's a really minor point.

Did you run 'make maintainer-check' on the series?

Thanks for working on this,
Ralf




Re: [PATCH] Minor improvements in comments of silent3.test

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Apr 22, 2010 at 10:51:49PM CEST:
> Subject: [PATCH] Minor improvements in comments of silent3.test.
> 
> * tests/silent3.test: Tell to keep it in sync with `silent9.test'
> too.

Thanks!




Re: [PATCH 5/5] Improved test silent5.test.

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 04:28:43PM CEST:
> At Sunday 25 April 2010, Ralf Wildenhues wrote:
> > > --- a/tests/silent5.test
> > > +++ b/tests/silent5.test
> > >
> > > @@ -116,7 +119,7 @@ do
> > >$MAKE >stdout || { cat stdout; Exit 1; }
> > >cat stdout
> > >grep ' -c' stdout && Exit 1
> > > -  grep ' -o ' stdout && Exit 1
> > > +  grep ' -o' stdout && Exit 1
> > 
> > This test has become less instead of more strict; oversight or
> > purpose?
> Why it should be less strict? Now even a command like:
>   gcc -ofoo foo.o
> would make the test fail, while previously a command like:
>   gcc -o foo foo.o
> was required.

D'oh.  Sorry 'bout that, I misread the patch.

> > >  grep mv stdout && Exit 1
> On the contrary, this seems too much strict, since it would fail (with 
> GNU make at least) if the automake source tree is placed in a 
> directory whose name contains the `mv' substring.

Indeed.  Grepping for '^mv ' and ' mv ' should work though.

> The other 
> silent*.test tests might have a similar problem too.
> This should IMHO be addressed in a different patch series.  WDYT?

Well, fix this first then have the new patches be correct right away.
There is no point adding new code with known bugs.

> > > +  # Ensure a clean rebuild.
> > >$MAKE clean
> > > +  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
> > 
> > Hmm, I wonder if doing clean and rebuild with the same V flag (and
> > without removing generated sources in between) would be a sensible
> > addition on top of this: it might trigger a different set of rules
> > (as I think you may be able to see with heirloom make).
> Yes, more sanity checks wouldn't hurt I guess.
> Should I amend the patch, or are you going to do that yourself?

Feel free to amend.

> > > +  # Ensure a clean reconfiguration/rebuild.
> > >$MAKE clean
> > >$MAKE maintainer-clean
> > > +  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
> > 
> > Wait, maintainer-clean should have removed all these files at this
> > point (and some of the other lex/yacc tests should have this
> >  tested, too).  Does that not work for you?
> No, it works just fine; but in the (unlikely) case of a failure, it 
> could cause false positives (or even false negatives!) in 
> silent5.test.

Well, but failure in case of a bug is a good thing, even if it is
drive-by failure.  At least for semantics that are known to work.

> Also, silent5.test is not supposed to test `maintainer-clean' w.r.t.
> Lex/Yacc;

No; but one general idea is that if you have a test for some specific
semantic X, then in tests where you don't check for X, you may assume
that generally, X just works.  OK?

> > Did you run 'make maintainer-check' on the series?
> *Blush*  Obviously no; and in fact `make maintainer-check' spuriously 
> fails with:

> I really think that the maintainer-checks should be made more 
> configurable esp. w.r.t. whitelists (but this is obviously material for 
> an unrelated patch series); for the moment, I just amended the patch 
> to avoid that spurious warning (updated patch is attached).

Looks better, thanks.  I'll wait for the mv issue above.

Cheers,
Ralf




Re: [PATCH 5/5] Improved test silent5.test.

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 05:13:11PM CEST:
> At Sunday 25 April 2010, Ralf Wildenhues wrote:
> > Indeed.  Grepping for '^mv ' and ' mv ' should work though.
> Or better again, we could strip off the `Entering/Leaving directory' 
> lines outputted by GNU make.  WDYT?

Other makes have the tendency to print other unrelated stuff.

> > > > > +  # Ensure a clean reconfiguration/rebuild.
> > > > >$MAKE clean
> > > > >$MAKE maintainer-clean
> > > > > +  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
> > > >
> > > > Wait, maintainer-clean should have removed all these files at
> > > > this point (and some of the other lex/yacc tests should have
> > > > this tested, too).  Does that not work for you?
> > >
> > > No, it works just fine; but in the (unlikely) case of a failure,
> > > it could cause false positives (or even false negatives!) in
> > > silent5.test.
> > 
> > Well, but failure in case of a bug is a good thing, even if it is
> > drive-by failure.  At least for semantics that are known to work.
> OK, then I'll turn that `rm -f' into sanity checks with `test ! -f'.

Why?  This is tested for in another test, and you didn't seem to think
before that it would be broken at the end of the loop.  That's not
logical.

Oh well, not a big deal either way.

Cheers,
Ralf




Re: [PATCH] Make badopt.test stricter (by enabling `set -e').

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 02:42:04PM CEST:
> At Sunday 25 April 2010, Ralf Wildenhues wrote:
> > For what it's worth, since git this issue should be fairly moot.
> > You can keep branches for a long time, and merge them into your
> > devel-branch-du-jour for testing them.  You can squash stuff into
> > them.  You can rebase them if you think that would help you, but
> > frankly, don't.  Just keep the patch from where you developed it,
> > unless it requires newer stuff.  When that happens, you can either
> > rebase, or merge maint (or whatever else newer you need) into your
> > branch and continue.  Only then, you would need to start publishing
> > trees or git bundles, so that merges are handled upstream.
> >
> Well, this is exactly what I usually do, and is also very convenient 
> for me; but I tought that it would have been less convient *for you* 
> to have bigger patches to review, especially if these patches had been 
> written incrementally.  Apparently this is not the case: thanks for 
> claryfing this out.

Well, that is the case if the patches do conceptually different things.
But not for patches that do the same thing.  In fact, for this kind of
patch I might just trust that you did check that they are ok.

* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 02:49:22PM CEST:
> That said, I think this patch should be applied as-is, since it fixes a 
> potential false negative in the tests.

OK, for maint.

Thanks,
Ralf




Re: [PATCH 5/5] Improved test silent5.test.

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 05:36:49PM CEST:
> At Sunday 25 April 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Sun, Apr 25, 2010 at 05:13:11PM CEST:
> > > At Sunday 25 April 2010, Ralf Wildenhues wrote:
> > and you didn't seem to
> >  think before that it would be broken at the end of the loop. 
> Sorry, I don't understand what you are saying here.  Can you elaborate 
> a bit more?

Never mind.  Thinko of mine.  Sorry.




Fix placing of ellipses in English text.

2010-04-25 Thread Ralf Wildenhues
a greeting from the language police.  ;-)

Pushing to master.

Cheers,
Ralf

Fix placing of ellipses in English text and synopses.

* Makefile.am: Be sure to add a space before `...' in natural
language text.
* automake.in (scan_autoconf_traces): Likewise.
* lib/Automake/Rule.pm (define): Likewise.
* lib/Automake/Variable.pm (define): Likewise.
* lib/am/dejagnu.am: Likewise.
* lib/am/progs.am: Likewise.
* lib/gnupload (dprint, upload): Likewise.
* tests/confdeps.test: Likewise.
* tests/location.test: Adjust expected output.
* automake.in (usage): In synopsis, use singular for OPTION,
* remove space before ellipsis.
* aclocal.in (usage): Likewise.  Also, fix indentation.

diff --git a/Makefile.am b/Makefile.am
index f5ab44f..829418b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -595,7 +595,7 @@ fetch:
  >>Fetchdir/update.patch 2>/dev/null; then :; \
  else \
stat=1; \
-   echo "Updating $(srcdir)/lib/$$file..."; \
+   echo "Updating $(srcdir)/lib/$$file ..."; \
cp Fetchdir/$$file $(srcdir)/lib/$$file; \
  fi; \
done; \
diff --git a/aclocal.in b/aclocal.in
index c229367..964a1b5 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -869,14 +869,14 @@ sub usage ($)
 {
   my ($status) = @_;
 
-  print "Usage: aclocal [OPTIONS] ...
+  print "Usage: aclocal [OPTION]...
 
 Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
 
 Options:
   --acdir=DIR   directory holding config files (for debugging)
   --diff[=COMMAND]  run COMMAND [diff -u] on M4 files that would be
-  changed (implies --install and --dry-run)
+changed (implies --install and --dry-run)
   --dry-run pretend to, but do not actually update any file
   --force   always update output file
   --helpprint this help, then exit
diff --git a/automake.in b/automake.in
index e8a9727..33e5846 100644
--- a/automake.in
+++ b/automake.in
@@ -5350,7 +5350,7 @@ sub scan_autoconf_traces ($)
  if ($seen_init_automake)
{
  error ($where, "AC_CONFIG_AUX_DIR must be called before "
-. "AM_INIT_AUTOMAKE...", partial => 1);
+. "AM_INIT_AUTOMAKE ...", partial => 1);
  error ($seen_init_automake, "... AM_INIT_AUTOMAKE called here");
}
  $config_aux_dir = $args[1];
@@ -8341,7 +8341,7 @@ sub generate_makefile ($$)
 # Print usage information.
 sub usage ()
 {
-print "Usage: $0 [OPTION] ... [Makefile]...
+print "Usage: $0 [OPTION]... [Makefile]...
 
 Generate Makefile.in for configure from Makefile.am.
 
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index d7e7105..ad63cc5 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -659,7 +659,7 @@ sub define ($)
  ## is legitimate. (This is phony.test.)
 
  # msg ('syntax', $where,
- #  "redefinition of `$target'$condmsg...", partial => 1);
+ #  "redefinition of `$target'$condmsg ...", partial => 1);
  # msg_cond_rule ('syntax', $cond, $target,
  #"... `$target' previously defined here");
}
@@ -695,7 +695,7 @@ sub define ($)
 
  msg_cond_rule ('override', $cond, $target,
 "user target `$target' defined here"
-. "$condmsg...", partial => 1);
+. "$condmsg ...", partial => 1);
  msg ('override', $where,
   "... overrides Automake target `$oldname' defined here",
   partial => $hint);
@@ -719,7 +719,7 @@ sub define ($)
  my $oldsource = $tdef->source;
  return () if $source eq $oldsource && $target eq $oldname;
 
- msg ('syntax', $where, "redefinition of `$target'$condmsg...",
+ msg ('syntax', $where, "redefinition of `$target'$condmsg ...",
   partial => 1);
  msg_cond_rule ('syntax', $cond, $target,
 "... `$oldname' previously defined here");
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 5d7c1d5..af0515e 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -881,7 +881,7 @@ sub define ()
{
  error ($def->location,
 "Automake variable `$var' was set with `"
-. $def->type . "=' here...", partial => 1);
+. $def->type . "=' here ...", partial => 1);
  error ($where, "... and is now set with `$type=' here.");
  prog_error ("Automake variable assignments should be consistently\n"
  . "defined with the same sign.");
@@ -896,7 +896,7 @@ sub define ()
  my $condmsg = ($cond == TRUE
   

Fix typo in manual.

2010-04-25 Thread Ralf Wildenhues
For maint.

Cheers,
Ralf

Fix typo in manual.

* doc/automake.texi (Simple Tests using parallel-tests): Add missing
closing parenthesis.

diff --git a/doc/automake.texi b/doc/automake.texi
index ae5e364..939ea00 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8716,7 +8716,7 @@ set of converted log files.  The log and HTML files are 
removed upon
 @vindex DISABLE_HARD_ERRORS
 @cindex Exit status 99, special interpretation
 @cindex hard error
-Even in the presence of expected failures (see @code{XFAIL_TESTS}, there
+Even in the presence of expected failures (see @code{XFAIL_TESTS}), there
 may be conditions under which a test outcome needs attention.  For
 example, with test-driven development, you may write tests for features
 that you have not implemented yet, and thus mark these tests as expected




Fix leftover call to removed function macros_dump.

2010-04-25 Thread Ralf Wildenhues
This fixes a theoretical bug introduced with incomplete renaming in a
2003-05-25 patch.  I do not know how to trigger the failure path except
by actually introducing the bug in automake.in (tested by replacing the
'if' condition with one that evaluates to true).

For maint.

Cheers,
Ralf

Fix leftover call to removed function macros_dump.

* automake.in (read_main_am_file): Call variables_dump, not
macros_dump.  Print actual error before list of variables.

diff --git a/automake.in b/automake.in
index 490c23f..baccad5 100644
--- a/automake.in
+++ b/automake.in
@@ -7050,7 +7050,7 @@ sub read_main_am_file
 my ($amfile) = @_;
 
 # This supports the strange variable tricks we are about to play.
-prog_error (macros_dump () . "variable defined before read_main_am_file")
+prog_error ("variable defined before read_main_am_file\n" . variables_dump 
())
   if (scalar (variables) > 0);
 
 # Generate copyright header for generated Makefile.in.




testsuite: ensure verbose printing of captured output.

2010-04-25 Thread Ralf Wildenhues
for f in tests/*test
do
  sed = $f |
  sed -n 'N
  s/\n/:/
  /2> *stderr/{
N
N
s/[^\n]*\n//
s/\n/:/
/cat stderr/!p
  }' |
  sed "s|^|$f:|"
done

found another couple of missed verbose printing of captured output,
one more with s/stderr/stdout/.

For maint.

Cheers,
Ralf

testsuite: ensure verbose printing of captured output.

* tests/acloca14.test, tests/acloca18.test, tests/aclocal.test,
tests/fort2.test, tests/help.test, tests/missing3.test,
tests/missing6.test: Print captured stdout or stderr before
grepping it.

diff --git a/tests/acloca14.test b/tests/acloca14.test
index 8ddbb1a..a4e86d7 100755
--- a/tests/acloca14.test
+++ b/tests/acloca14.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -109,4 +109,5 @@ $MAKE testdist2
 # Make sure aclocal diagnose missing included files with correct `file:line:'.
 rm -f b.m4
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'a.m4:1:.*b.m4.*does not exist' stderr
diff --git a/tests/acloca18.test b/tests/acloca18.test
index 22feb23..276e5ba 100755
--- a/tests/acloca18.test
+++ b/tests/acloca18.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005, 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -87,6 +87,7 @@ grep macro23 foo
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2'
 rm -f foo
 $ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep AM_MACRO2 stderr
 
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1'
diff --git a/tests/aclocal.test b/tests/aclocal.test
index 6b87a9d..d3437d2 100755
--- a/tests/aclocal.test
+++ b/tests/aclocal.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2004, 2008  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2004, 2008, 2010 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,14 +25,17 @@ $ACLOCAL --output=fred
 test -f fred
 
 $ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'option.*--output.*an argument' stderr
 grep help stderr
 
 $ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'unrecognized.*--unknown-option' stderr
 grep help stderr
 
 $ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'unrecognized.*--ver' stderr
 grep help stderr
 
diff --git a/tests/fort2.test b/tests/fort2.test
index 3568189..70d13f2 100755
--- a/tests/fort2.test
+++ b/tests/fort2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,6 +48,7 @@ $AUTOMAKE
 grep '.\$(LINK)'   Makefile.in && Exit 1
 grep '.\$(FCLINK)' Makefile.in
 grep '.\$(FCCOMPILE)'  Makefile.in > stdout
+cat stdout
 grep -v '\$(FCFLAGS_f' stdout && Exit 1
 grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && Exit 1
 # Notice the TAB:
diff --git a/tests/help.test b/tests/help.test
index d4d7110..e9ccf62 100755
--- a/tests/help.test
+++ b/tests/help.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@ $AUTOMAKE --help
 
 # aclocal and automake cannot work without configure.ac or configure.in
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep configure.ac stderr
 grep configure.in stderr
 AUTOMAKE_fails
diff --git a/tests/missing3.test b/tests/missing3.test
index 07ef779..d3a7823 100755
--- a/tests/missing3.test
+++ b/tests/missing3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,23 +23,30 @@ set -e
 # b7cb8259 assumed not to exist.
 
 ./missing b7cb8259 --version 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep . stderr && Exit 1
 ./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 gre

Fix more duplicate message prefixes.

2010-04-25 Thread Ralf Wildenhues
I missed a couple of duplicate message prefixes in the 2010-04-11
changes to master.  Fixing thusly.

Cheers,
Ralf

Fix more duplicate message prefixes.

* lib/Automake/XFile.pm (seek): Do not prepend $me.
($me): Remove now-unused package-global.
* aclocal.in (check_acinclude): Remove duplicate 'warning: '
prefix.

diff --git a/aclocal.in b/aclocal.in
index 9622711..c229367 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -183,8 +183,7 @@ sub check_acinclude ()
   foreach my $key (keys %map)
 {
   # FIXME: should print line number of acinclude.m4.
-  msg ('syntax', "warning: macro `$key' defined in "
-  . "acinclude.m4 but never used")
+  msg ('syntax', "macro `$key' defined in acinclude.m4 but never used")
if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
 }
 }
diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm
index a7bb219..67298f9 100644
--- a/lib/Automake/XFile.pm
+++ b/lib/Automake/XFile.pm
@@ -98,9 +98,6 @@ eval {
   push (@EXPORT, @O);
 };
 
-# Used in croak error messages.
-my $me = basename ($0);
-
 =head2 Methods
 
 =over
@@ -267,7 +264,7 @@ sub seek
   if (!seek ($fh, $_[0], $_[1]))
 {
   my $file = $fh->name;
-  fatal "$me: cannot rewind $file with @_: $!";
+  fatal "cannot rewind $file with @_: $!";
 }
 }
 




Warning and error message formatting cleanups.

2010-04-25 Thread Ralf Wildenhues
Some more trivial cleanup for GNU Coding Standards requirements in
message formatting, and blunders like trailing newlines in messages.

I'm not actually sure what to do when messages consist of two sentences.
For now I kept the period at the end of the first and the capitalization
of the second.

This is for master only, I didn't care to backport this work.
I will push things out once the testsuite run has finished.

Thanks,
Ralf

Warning and error message formatting cleanups.

* aclocal.in (parse_arguments, main): Remove trailing period or
newline in error or warning messages, avoid capitalization of
the first word of a message.
* automake.in (check_user_variables, handle_languages)
(handle_ltlibraries, scan_aclocal_m4, scan_autoconf_config_files)
(scan_autoconf_files, cond_stack_if, require_file_internal)
(usage, generate_makefile, parse_arguments): Likewise.
* lib/Automake/ChannelDefs.pm (set_strictness): Likewise.
* lib/Automake/Configure_ac.pm (find_configure_ac): Likewise.
* lib/Automake/Options.pm (set_strictness): Likewise.
* lib/Automake/Rule.pm (define): Likewise.
* lib/Automake/Variable.pm (define, variables_dump): Likewise.
* tests/ltinstloc.test: Adjust expected error message.
* lib/Automake/Channels.pm (setup_channel): Reword error message
to be the same as in msg.

diff --git a/aclocal.in b/aclocal.in
index 964a1b5..06d69ed 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -981,13 +981,13 @@ sub parse_arguments ()
}
   if (exists $argopts{$ARGV[0]})
{
- fatal ("option `$ARGV[0]' requires an argument\n"
-. "Try `$0 --help' for more information.");
+ fatal ("option `$ARGV[0]' requires an argument.\n"
+. "Try `$0 --help' for more information");
}
   else
{
  fatal ("unrecognized option `$ARGV[0]'\n"
-. "Try `$0 --help' for more information.");
+. "Try `$0 --help' for more information");
}
 }
 
@@ -1008,7 +1008,7 @@ sub parse_arguments ()
   if ($install && !...@user_includes)
 {
   fatal ("--install should copy macros in the directory indicated by the"
-. "\nfirst -I option, but no -I was supplied.");
+. "\nfirst -I option, but no -I was supplied");
 }
 
   if (! -d $system_includes[0])
@@ -1059,7 +1059,7 @@ my $loop = 0;
 while (1)
   {
 ++$loop;
-prog_error "Too many loops." if $loop > 2;
+prog_error "too many loops" if $loop > 2;
 
 reset_maps;
 scan_m4_files;
diff --git a/automake.in b/automake.in
index 33e5846..05b8711 100644
--- a/automake.in
+++ b/automake.in
@@ -1327,7 +1327,7 @@ sub check_user_variables (@)
  msg_cond_var ('gnu', $cond, $flag,
"`$flag' is a user variable, "
. "you should not override it;\n"
-   . "use `AM_$flag' instead.");
+   . "use `AM_$flag' instead");
}
}
}
@@ -1587,7 +1587,7 @@ sub handle_languages
my $srcdir = dirname ($source);
if ($lang->ansi && $obj =~ /\$U/)
  {
-   prog_error "`$obj' contains \$U, but `$source' doesn't."
+   prog_error "`$obj' contains \$U, but `$source' doesn't"
  if $source !~ /\$U/;
 
(my $source_ = $source) =~ s/\$U/_/g;
@@ -2894,7 +2894,7 @@ sub handle_ltlibraries
 
   my $onlyone = ($dir ne $adir) ?
 ("\nLibtool libraries can be built for only one "
- . "destination.") : "";
+ . "destination") : "";
 
   error ($liblocations{$val}{$acond},
  "... and should also be $adirtxt$adircond.$onlyone");
@@ -4133,7 +4133,7 @@ sub scan_aclocal_m4 ()
   push (@ac_deps, '$(ACLOCAL_M4_SOURCES)');
   msg_var ('obsolete', 'ACLOCAL_M4_SOURCES',
   "`ACLOCAL_M4_SOURCES' is obsolete.\n"
-  . "It should be safe to simply remove it.");
+  . "It should be safe to simply remove it");
 }
 
   # Note that it might be possible that aclocal.m4 doesn't exist but
@@ -5225,8 +5225,8 @@ sub scan_autoconf_config_files ($$)
   my ($local, @rest) = split (/:/);
   @rest = ("$local.in",) unless @rest;
   msg ('portability', $where,
- "Omit leading `./' from config file names such as `$local',"
- . "\nas not all make implementations treat `file' and `./file' 
equally.")
+ "omit leading `./' from config file names such as `$local',"
+ . "\nas not all make implementations treat `file' and `./file' 
equally")
if ($local =~ /^\.\//);
   my $input = locate_am @rest;
   if ($input)
@@ -5586,7 +5586,7 @@ sub scan_autoconf_files ()
  . "should verify that $configure_ac invokes AM_INIT_AUTOMAKE,"
  . "\nthat aclocal.m4 is 

Re: Warning and error message formatting cleanups.

2010-04-25 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Sun, Apr 25, 2010 at 07:11:14PM CEST:
> This is for master only, I didn't care to backport this work.
> I will push things out once the testsuite run has finished.

Done with this squashed in.

diff --git a/ChangeLog b/ChangeLog
index ffe4715..71b0d9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,7 +13,8 @@
* lib/Automake/Options.pm (set_strictness): Likewise.
* lib/Automake/Rule.pm (define): Likewise.
* lib/Automake/Variable.pm (define, variables_dump): Likewise.
-   * tests/ltinstloc.test: Adjust expected error message.
+   * tests/ltinstloc.test, tests/suffix11.test: Adjust expected
+   error message.
* lib/Automake/Channels.pm (setup_channel): Reword error message
to be the same as in msg.
 
diff --git a/tests/suffix11.test b/tests/suffix11.test
index e38926a..35cb41a 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ $ACLOCAL
 $AUTOCONF
 # What we do is not portable.  Automake should warn.
 AUTOMAKE_fails -a
-grep 'Inference rules can have only one target before the colon' stderr
+grep 'inference rules can have only one target before the colon' stderr
 # But this should work anyway.
 $AUTOMAKE -a -Wno-portability
 ./configure




Re: [PATCH 8/9] Tests on extensibility of silent-rules made stricter.

2010-04-25 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Mon, Apr 26, 2010 at 12:15:33AM CEST:
> --- a/tests/silent6.test
> +++ b/tests/silent6.test

> @@ -99,5 +99,3 @@ $AUTOMAKE
>  grep 'AM_V_GEN' Makefile.in
>  $AUTOMAKE --force -Wno-all -Wportability
>  grep 'AM_V_GEN' Makefile.in
> -
> -:

Please don't remove trailing ':' or 'Exit 0'.  They exist for a reason:
when somebody changes the test by adding a failing command after the
last command, the test will spuriously fail because $? is nonzero at the
end.  Keeping a trailing ':' prevents that.  (And no, please also don't
newly introduce these things just for the heck of it either (i.e., when
you wouldn't otherwise be editing the test), that's not the point.)

Thanks,
Ralf




Re: [PATCH 8/9] Tests on extensibility of silent-rules made stricter.

2010-04-26 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Mon, Apr 26, 2010 at 10:59:50AM CEST:
> By the way, I didn't understand if you're going to amend the patches 
> yourself, or if I should do that instead...

I can do that, but it's likely going to not be before the weekend.

Cheers,
Ralf




Re: [PATCH] Extend tests on `nostdinc' automake option.

2010-04-26 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Mon, Apr 26, 2010 at 02:05:19PM CEST:
> Extend tests on `nostdinc' automake option.
> 
> * tests/nostdinc.test: Make the grepping of the generated
> Makefile.in slighty stricter.  Enable `errexit' shell flag.
> Related and unrelated minor changes.
> Also, updated copyright years.
> * tests/nostdinc2.test: New test.
> * tests/Makefile.am (TESTS): Extended accordingly.

> @@ -18,9 +18,9 @@
>  
>  . ./defs || Exit 1
>  
> -cat >> configure.in << 'END'
> -AC_PROG_CC
> -END
> +set -e
> +
> +echo AC_PROG_CC >> configure.in

In the future, please don't change these kinds of things gratuitously.
Same rationale as trailing ':': using a here-document allows
straight-forward way to extend the text later.

Also, there is generally no need to mention updated copyright years in
the ChangeLog entry unless that is the only change you do (e.g., because
it was forgotten).  This kind of change is expected.  Same reason we
don't mention regenerated Makefile.in files.  Note some other FSF
projects do this differently (notably GCC and binutils).

Since with your patch, nostdinc.test is a strict subset of
nostdinc2.test, why not merge nostdinc2.test into nostdinc.test?  Our
testsuite is slow as it is already.

Thanks for all your work on the testsuite,
Ralf




Re: [PATCH] Typofix in ChangeLog entry (2010-04-11, Stefano Lattarini)

2010-05-23 Thread Ralf Wildenhues
Hi Stefano,

apologies for letting the patch backlog grow so large.  I guess I better
tick off patches dealt with, that may make tracking things easier.

* Stefano Lattarini wrote on Sat, May 08, 2010 at 03:23:30AM CEST:
> Do not leave an empty line between change's summary and details of 
> changes on single files.

> From acb3531118af5bf29a0b045c532d649bd72fa5cd Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Sat, 8 May 2010 03:20:19 +0200
> Subject: [PATCH] Typofix in ChangeLog entry (2010-04-11, Stefano Lattarini)

Thanks!  For maint.

Cheers,
Ralf



Re: [PATCH] Fixed uncorrectly ordered ChangeLog entries.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, May 11, 2010 at 12:16:39PM CEST:
> Oops.  There was a typo in the git commit message :-(
> An amended patch is attached.

> From 3025ae248e87ff6fa6c6bf9d64d6ee4f17246744 Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Sun, 9 May 2010 15:06:25 +0200
> Subject: [PATCH] Fixed uncorrectly ordered ChangeLog entries.

> -2010-04-22  Stefano Lattarini  
> -
> - Minor improvements in comments of test `silent3.test'.
> - * tests/silent3.test: Tell to keep it in sync with `silent9.test'
> - too.
> -
> -2010-04-25  Ralf Wildenhues  
> -
>   testsuite: ensure verbose printing of captured output.
>   * tests/acloca14.test, tests/acloca18.test, tests/aclocal.test,
>   tests/fort2.test, tests/help.test, tests/missing3.test,
>   tests/missing6.test: Print captured stdout or stderr before
>   grepping it.
>  
> +2010-04-22  Stefano Lattarini  
> +
> + Minor improvements in comments of test `silent3.test'.
> + * tests/silent3.test: Tell to keep it in sync with `silent9.test'
> + too.
> +

Well, that's once again difference between the author date of the patch
and the commit date.  The patches were committed on 2010-04-25, and GCS
generally recommend using the commit date.  I prefer that to keep the
order in the ChangeLog as consistent as possible with the commit order.
Of course, that's not always possible in the presence of work done on
branches.

I'm applying this patch instead in your name, to maint.

Cheers,
Ralf

commit 5eb0bf21fba328450fbf41d19ed2e592ba4506f2
Author: Stefano Lattarini 
Date:   Sun May 23 13:58:44 2010 +0200

Fix a ChangeLog commit date, for consistent order.

Signed-off-by: Ralf Wildenhues 

diff --git a/ChangeLog b/ChangeLog
index 7010e85..a9562c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,7 @@
* automake.in (read_main_am_file): Call variables_dump, not
macros_dump.  Print actual error before list of variables.
 
-2010-04-22  Stefano Lattarini  
+2010-04-25  Stefano Lattarini  
 
Minor improvements in comments of test `silent3.test'.
* tests/silent3.test: Tell to keep it in sync with `silent9.test'



Re: [PATCH] Fix conflnk3.test to work with Solaris/Heirloom Sh.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, May 06, 2010 at 07:53:41PM CEST:
> From d294e89fcdbfc7b5abf92ee9031647460eec490d Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Thu, 6 May 2010 18:12:25 +0200
> Subject: [PATCH] Fix conflnk3.test to work with Solaris/Heirloom Sh.
> 
> * tests/conflnk3.test: Use `test -r FILE' and `test ! -r FILE'
> instead of respectively `test -e FILE' and `test ! -e FILE',
> since Solaris Sh doesn't grok the latter.  Do not SKIP the test
> if the shell doesn't support `test -e'.

Thanks!  For maint.



Re: [PATCH] Avoid possible false negatives in dejagnu7.test.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, May 06, 2010 at 12:47:02PM CEST:
> Enable the shell `errexit' flag in `tests/dejagnu7.test', so that 
> previously unchecked failures now cause the whole test to fail.
> Also, avoid unportable use of fgrep option `-e'.

> From 9b487b1e65ca5d0e3361c484fe624a729c9245fc Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Thu, 6 May 2010 03:18:45 +0200
> Subject: [PATCH] Avoid possible false negatives in dejagnu7.test.
> 
> * tests/dejagnu7.test: Enable shell `errexit' flag.  Also, avoid
> unportable use of fgrep option `-e'.

Thanks!  For maint.



Re: [PATCH] Fixed uncorrectly ordered ChangeLog entries.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, May 23, 2010 at 02:08:20PM CEST:
> At Sunday 23 May 2010, Ralf Wildenhues wrote:
> > Well, that's once again difference between the author date of the
> >  patch and the commit date.  The patches were committed on
> >  2010-04-25, and GCS generally recommend using the commit date.
> >  I prefer that to keep the order in the ChangeLog as consistent as
> >  possible with the commit order.
> 
> >  Of course, that's not always possible in the presence of work
> >  done on branches.
> Right, I didn't think of that.  Do you think it would be better not to 
> bother with such minor ChangeLog blemishes in the future?

No that's fine, I don't mind such fixes.

Cheers,
Ralf



Re: [PATCH] Add tests about support of wildcards in EXTRA_DIST

2010-05-23 Thread Ralf Wildenhues
Long ago:
<http://lists.gnu.org/archive/html/automake-patches/2010-02/msg00017.html>

* Ralf Wildenhues wrote on Sat, Feb 20, 2010 at 05:42:30PM CET:
> * Stefano Lattarini wrote on Sat, Feb 20, 2010 at 04:49:37PM CET:
> > I've written a small patch adding some tests.  Note that they are mostly
> > tentative, and might also be inclomplete, since I have always used the
> > "dist" features of Automake only in the most basic ways.  But incomplete
> > is better than missing, I think.
> 
> Thanks!  Tested with GNU and FreeBSD make, queued to maint, for
> branch-1.11 and master.  We'll see if other makes have problems.
> 
> > From 5f22886459c360e43ecd762efb058c53c0691bbb Mon Sep 17 00:00:00 2001
> > From: Stefano Lattarini 
> > Date: Sat, 20 Feb 2010 16:41:56 +0100
> > Subject: [PATCH] Add tests about support of wildcards in EXTRA_DIST.
> > 
> > * tests/extra10.test: New test, check basic support of wildcards
> > in EXTRA_DIST.
> > * tests/extra11.test: New test, check more complex usage of
> > wildcards in EXTRA_DIST.
> > * tests/extra11.test: New test, check usage of wildcards in
> > EXTRA_DIST when $builddir != $srcdir.
> > * tests/Makefile.am (TESTS): Updated accordingly.
> > Necessity of these new tests suggested by Braden McDaniel
> >  and Ralf Wildenhues 

Unfortunately that turned out to be too optimistic.  I'm pushing this
followup to maint.  Tested on NetBSD 5.99.29 and the pmake package of
Debian.

Cheers,
Ralf

Wildcards are not portable to NetBSD make.

* doc/automake.texi (Wildcards): Document portability issue.
* tests/extra10.test, tests/extra11.test, tests/extra12.test:
Require GNU make.

diff --git a/doc/automake.texi b/doc/automake.texi
index 48bf33a..9d400e9 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -10644,6 +10644,11 @@ even though a file is missing. By listing files, 
@samp{make dist}
 @emph{will} complain.
 
 @item
+Wildcards are not portable to some non-GNU @command{make} implementations,
+e.g., NetBSD @command{make} will not expand globs such as @samp{*} in
+prerequisites of a target.
+
+...@item
 Finally, it's really hard to @emph{forget} to add a file to
 @file{Makefile.am}: files that are not listed in @file{Makefile.am} are
 not compiled or installed, so you can't even test them.
diff --git a/tests/extra10.test b/tests/extra10.test
index 16d06a3..7bd6556 100755
--- a/tests/extra10.test
+++ b/tests/extra10.test
@@ -17,6 +17,7 @@
 # Check that wildcards in EXTRA_DIST are honoured.
 # Suggested by observations from Braden McDaniel.
 
+required=GNUmake
 . ./defs || Exit 1
 
 set -e
diff --git a/tests/extra11.test b/tests/extra11.test
index 14dda42..a0c55ca 100755
--- a/tests/extra11.test
+++ b/tests/extra11.test
@@ -17,6 +17,7 @@
 # Check for more complex usage of wildcards in EXTRA_DIST.
 # Suggested by observations from Braden McDaniel.
 
+required=GNUmake
 . ./defs || Exit 1
 
 set -e
diff --git a/tests/extra12.test b/tests/extra12.test
index 72b918c..db3bcc7 100755
--- a/tests/extra12.test
+++ b/tests/extra12.test
@@ -18,6 +18,7 @@
 # $srcdir != $builddir, if properly declared.
 # Suggested by observations from Braden McDaniel.
 
+required=GNUmake
 . ./defs || Exit 1
 
 set -e



Fix unportable sed script in maintainer-check test.

2010-05-23 Thread Ralf Wildenhues
For maint.

Cheers,
Ralf

Fix unportable sed script in maintainer-check test.

* Makefile.am (sc_tests_Exit_not_exit): Rewrite sed script to
not contain semicolon after 'b' or brace commands, for NetBSD.

diff --git a/Makefile.am b/Makefile.am
index c487874..bbcc882 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -323,7 +323,8 @@ sc_tests_here_document_format:
 ## Ignore comments, and ignore one perl line in ext2.test.
 sc_tests_Exit_not_exit:
@found=false; for file in $(srcdir)/tests/*.test; do \
- res=`sed -n '/^#/d; /^\$$PERL/d; /<<.*END/,/^END/{b;}; 
/<<.*EOF/,/^EOF/{b;}; /exit [$$0-9]/p' $$file`; \
+ res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
+ -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
  if test -n "$$res"; then \
echo "$$file:$$res"; \
found=true; \



Relax silent8.test for NetBSD make.

2010-05-23 Thread Ralf Wildenhues
Another spurious testsuite failure with NetBSD make.
Committed to master.

Cheers,
Ralf

Relax silent8.test for NetBSD make.

* tests/silent8.test: Accept ./foo.info in output as well.

diff --git a/tests/silent8.test b/tests/silent8.test
index 2546775..6833840 100755
--- a/tests/silent8.test
+++ b/tests/silent8.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -50,7 +50,8 @@ $MAKE V=0 dvi html info ps pdf >stdout || { cat stdout; Exit 
1; }
 cat stdout
 grep 'DVIPSfoo.ps' stdout || Exit 1
 grep 'MAKEINFO foo.html' stdout || Exit 1
-grep 'MAKEINFO foo.info' stdout || Exit 1
+# NetBSD make will print `./foo.info' instead of `foo.info'.
+grep 'MAKEINFO.*foo.info' stdout || Exit 1
 grep 'TEXI2DVI foo.dvi' stdout || Exit 1
 grep 'TEXI2PDF foo.pdf' stdout || Exit 1
 
@@ -59,7 +60,7 @@ $MAKE clean || Exit 1
 $MAKE V=1 dvi html info ps pdf >stdout || { cat stdout; Exit 1; }
 grep 'DVIPSfoo.ps' stdout && Exit 1
 grep 'MAKEINFO foo.html' stdout && Exit 1
-grep 'MAKEINFO foo.info' stdout && Exit 1
+grep 'MAKEINFO.*foo.info' stdout && Exit 1
 grep 'TEXI2DVI foo.dvi' stdout && Exit 1
 grep 'TEXI2PDF foo.pdf' stdout && Exit 1
 



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Mar 07, 2010 at 05:15:24PM CET:
> Generated tests are now just a thin layer around other tests.
> 
> * tests/Makefile.am: Rewrite the rule to generate the `*-p.test'
> test scripts so that any of them simply includes the corresponding
> `*.test' script (after setting `$parallel_tests' to `yes').
> * tests/.gitignore: Add wildcard for temporary files used in the
> generation of `*-p.test' tests.

Got lucky and intuition saved me from regressing branch-1.11 with this
one.  I'm applying the fix below on top of this patch and merging to
master.  The nontrivial point to note is that in the wrapper script,
srcdir needs to be expanded at testsuite run time only, because it may
differ from the srcdir value in the Automake developer tree.

Cheers,
Ralf

Fix distcheck failure with distributed generated parallel tests.

* tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
being different from the value at developer 'make dist' time.
While at it, also tolerate dependent tests in the build tree.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index cff34c5..bbeb2cb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,7 +34,11 @@ $(parallel_tests): Makefile.am
{ echo '#!/bin/sh'; \
  echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
  echo 'parallel_tests=yes'; \
- echo ". '$(srcdir)/$$input'"; \
+ echo "if test -f ./$$input; then"; \
+ echo "  . ./$$input"; \
+ echo 'else'; \
+ echo "  . \$$srcdir/$$input"; \
+ echo 'fi'; \
} > $...@-t
$(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@
 



Re: [PATCH] Fix Autoconf version required by Automake's configure.

2010-05-23 Thread Ralf Wildenhues
[ http://lists.gnu.org/archive/html/automake-patches/2010-04/msg00121.html ]

* Stefano Lattarini wrote on Fri, Apr 30, 2010 at 05:21:03PM CEST:
> At Friday 30 April 2010, Eric Blake wrote:
> > On 04/30/2010 08:56 AM, Stefano Lattarini wrote:
> > > Apparently, Automake configure script tells that automake
> > > requires autoconf 2.60 or later, but then it checks for autoconf 
> > > >= 2.62, and if it is not found it aborts saying that automake
> > > requires configure 2.61a-341 or later.  The attached patch should
> > > fix this.
> > 
> > Your proposed patch delays the check until configure time.
> Well, the pre-existing checks themselves were run only at configure 
> time.  And IMHO this is a correct behaviour, since the autoconf 
> version required to *use* automake and run its testsuite isn't 
> necessarly the same autoconf version required for its developement 
> (e.g. for the regeneration of its configure script).

I agree with this reasoning.  I'm taking the patch (for maint).

> By the way, adding an AC_PREREQ call in Automake's own configure.ac 
> would be nice IMHO; I didn't do that because I don't know what is the
> minimal autoconf version truly required by Automake's own configure.ac.

Well, it /should/ be the same as $required_autoconf_version.  However,
that point should also be a bit moot as the git tree should have the
generated files from the most recent stable Autoconf, if that is recent
enough.  If it isn't, then it definitely should be the same as
$required_autoconf_version.

Cheers,
Ralf



Re: [PATCH] Add tests about support of wildcards in EXTRA_DIST

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, May 23, 2010 at 02:41:24PM CEST:
> At Sunday 23 May 2010, Ralf Wildenhues wrote:
> > <http://lists.gnu.org/archive/html/automake-patches/2010-02/msg00017.html>
> 
> > Unfortunately that turned out to be too optimistic.  I'm pushing
> >  this followup to maint.  Tested on NetBSD 5.99.29 and the pmake
> >  package of Debian.
> > Wildcards are not portable to NetBSD make.
> > 
> > * doc/automake.texi (Wildcards): Document portability issue.
> > * tests/extra10.test, tests/extra11.test, tests/extra12.test:
> > Require GNU make.
> Isn't the requirement of GNU make too much strict?  After all, the tests
> works correctly with FreeBSD make and even with Heirloom make.

Yes maybe, but there is no easy way to distinguish, say, NetBSD make
from FreeBSD make, without testing details like wildcard support.
I don't want to get into the habit of denoting in the test suite which
makes can do which, after all, in practice packages will just want to
require GNU make anyway when they use features like wildcards.

Cheers,
Ralf



Re: [PATCH] Fix Autoconf version required by Automake's configure.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, May 23, 2010 at 03:11:28PM CEST:
> At Sunday 23 May 2010, Ralf Wildenhues  wrote:
> > > By the way, adding an AC_PREREQ call in Automake's own
> > > configure.ac would be nice IMHO; I didn't do that because I don't
> > > know what is the minimal autoconf version truly required by
> > > Automake's own configure.ac.
> > 
> > Well, it /should/ be the same as $required_autoconf_version.
> You are very welcome to amend my patch to add a AC_PREREQ([2.62])
> before AC_INIT in configure.ac, if you want to.

Well, that AC_PREREQ is already there effectively, only it's hidden in
m4/init.m4 in the AM_INIT_AUTOMAKE macro.

Cheers,
Ralf



Re: git-version-gen not EBCDIC compatible

2010-05-23 Thread Ralf Wildenhues
* Eric Blake wrote on Mon, Apr 26, 2010 at 05:44:35PM CEST:
> Thanks for the report.  I'll push this patch shortly for
> git-version-gen, but there are other culprits (MODULES.html.sh,
> gnupload, m4/get{delim,line}.m4, m4/javacomp.m4, posix-modules) that are
> still ascii-specific.

Thanks for the report.  I'm fixing gnupload in automake (maint branch)
as follows, and adding Steve to THANKS.

Cheers,
Ralf

Make gnupload portable to EBCDIC hosts.

* lib/gnupload: Use literal newline as argument for 'tr' rather
than \015, for EBCDIC hosts.  Also, avoid unportable nested
double-quotes and backquotes.
* THANKS: Update.
Report from Eric Blake and Steve Goetze via gnulib.

index d445075..5036752 100755
--- a/lib/gnupload
+++ b/lib/gnupload
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2010-02-08.07; # UTC
+scriptversion=2010-05-23.15; # UTC
 
 # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
 # Foundation, Inc.
@@ -32,6 +32,8 @@ delete_files=
 delete_symlinks=
 collect_var=
 dbg=
+nl='
+'
 
 usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
 
@@ -109,7 +111,8 @@ Send patches to ."
 # Read local configuration file
 if test -r "$conffile"; then
   echo "$0: Reading configuration file $conffile"
-  eval set x "`sed 's/#.*$//;/^$/d' \"$conffile\" | tr '\012\015' '  '` 
\"\...@\""
+  conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" '  '`
+  eval set x "$conf \"\...@\""
   shift
 fi
 



Re: [PATCH] Extend tests on `nostdinc' automake option.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Mon, Apr 26, 2010 at 09:41:06PM CEST:
> Subject: [PATCH] Extend test on `nostdinc' automake option.
> 
> * tests/nostdinc.test: Enable `errexit' shell flag.  Related and
> unrelated minor changes.  Make the grepping of the generated
> Makefile.in slighty stricter.  Generate and run configure, so that
> the generated Makefile can be grepped too.

Thanks, I've merged that, with one minor change:

> +# Test with $builddir == $srcdir

I get confused seeing a mixture of C and shell code spelling in a shell
script comment, so I changed this to $builddir = $srcdir.

Cheers,
Ralf



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-05-23 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, May 23, 2010 at 03:01:20PM CEST:
> At Sunday 23 May 2010, Ralf Wildenhues wrote:
> > Got lucky and intuition saved me from regressing branch-1.11 with
> >  this one.  I'm applying the fix below on top of this patch and
> >  merging to master.  The nontrivial point to note is that in the
> >  wrapper script, srcdir needs to be expanded at testsuite run time
> >  only, because it may differ from the srcdir value in the Automake
> >  developer tree.
> Good catch.  Note that my patch on the sepration of instspc.test has 
> this same problem too.

OK, good to know.  I haven't looked at the instspc patches yet.

> However, I think that a better way to resolve this problem would be to 
> make @abs_srcdir@ substituted in defs.in (dropping the computation of 
> $srcdir), and make defs.in robust w.r.t. multiple inclusion; then the 
> generated test files could do simply:
> 
> #!/bin/sh
> parallel_tests=yes
> . ./defs.in
> . $testsrcdir/INPUT.test

Hmm, yes, maybe.  This needs quoting for spaces in abs_srcdir.
Also, doesn't it remove the automatic 'set -x' when we detect
scripts run manually?

> > diff --git a/tests/Makefile.am b/tests/Makefile.am
> > index cff34c5..bbeb2cb 100644
> > --- a/tests/Makefile.am
> > +++ b/tests/Makefile.am
> > @@ -34,7 +34,11 @@ $(parallel_tests): Makefile.am
> > { echo '#!/bin/sh'; \
> >   echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
> >   echo 'parallel_tests=yes'; \
> > - echo ". '$(srcdir)/$$input'"; \
> > + echo "if test -f ./$$input; then"; \
> > + echo "  . ./$$input"; \
> > + echo 'else'; \
> > + echo "  . \$$srcdir/$$input"; \
> ... this prevent the test script from working when run from the 
> command line in a VPATH build -- with an error like:
>   ./check-p.test: line 7: /check.test: No such file or directory

Yeah, that's bad.  One alternative would be to generate *-p.test in the
source tree right away; after all, 'make dist' will have them end up
there in an extracted tarball anyway.

Cheers,
Ralf



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-03 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Sun, May 23, 2010 at 05:51:15PM CEST:
> Here it is my attempt to a patch.

Thanks.  This seems to work ok, but this:

> +# Protect against attempted multiple inclusions of this file.
> +# This might be especially useful in generated test scripts.
> +echo 'echo "$me: ./defs already included"' > defs
> +

is such an ugly thing, because we now litter the test directories.
I'd prefer to avoid that, unless it means very ugly constructs.

Thanks,
Ralf



Re: [PATCH 0/9] Extend and improve tests on Automake's silent-mode

2010-06-06 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Sun, Apr 25, 2010 at 11:53:43PM CEST:
> Here I (re)propose a series of patches to improve and extend the tests
> on Automake's silent-mode.

Thanks.

> This series is an extension/improvement over my previous patch
> series "[PATCH 0/5] Modularize testing of automake silent-mode for
> languages != C".   For a reference see:
>  

I'm merging the whole patch series as follows:
- 1/9 goes into the je-silent branch, which I subsequently merge into
  maint again.  I fixed the typo s/for/to in the log entry.
- 6/9 is amended with reformatting, so the shell function declarations
  look GCS-like:
func ()
{
  ...
}
- except for 9/9, everything else goes into maint, subsequently merged
  into master and branch-1.11,
- 9/9 goes into jk-silent, then merged into master.

Cheers, and sorry for the delay,
Ralf



Re: Comment on introduction pages

2010-06-06 Thread Ralf Wildenhues
Hello Christina,

* Christina Gratorp wrote on Fri, Jun 04, 2010 at 08:58:53AM CEST:
> I have a suggestion that would make a difference when visiting your
> otherwise eminent website:
> http://sources.redhat.com/automake/automake.html#Introduction. The sentence
> "The developer expresses the recipe to build *his* package in a Makefile"
> must be wrong since I'm a woman and a user and have packages I want to build
> and those packages are mine, i.e *hers* would be correct in this case. (I
> know that his could be considered neutral but really, it doesn't feel that
> way.)

Thanks again for the report.  I went through the manual and changed all
instances that I could find, as below, and added you to THANKS.  The
patch is for maint, merged in branch-1.11 and master.

Cheers,
Ralf

Rewrite manual to be gender-neutral.

* doc/automake.texi (GNU Build System)
(Standard Directory Variables, General Operation, CVS)
(Hard-Coded Install Paths, Dependencies As Side Effects):
Rewrite text to not contain gender-specific pronouns when
speaking about developers or users, either by avoiding pronouns
or by addressing them as `you' instead.
* THANKS: Update.
Report by Christina Gratorp.

diff --git a/doc/automake.texi b/doc/automake.texi
index 59018ca..2bf3291 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -456,13 +456,13 @@ GNU Build System
 @section Introducing the GNU Build System
 @cindex GNU Build System, introduction
 
-It is a truth universally acknowledged, that a developer in
-possession of a new package, must be in want of a build system.
+It is a truth universally acknowledged, that as a developer in
+possession of a new package, you must be in want of a build system.
 
 In the Unix world, such a build system is traditionally achieved using
 the command @command{make} (@pxref{Top, , Overview, make, The GNU Make
-Manual}).  The developer expresses the recipe to build his package in
-a @file{Makefile}.  This file is a set of rules to build the files in
+Manual}).  You express the recipe to build your package in a
+...@file{makefile}.  This file is a set of rules to build the files in
 the package.  For instance the program @file{prog} may be built by
 running the linker on the files @file{main.o}, @file{foo.o}, and
 @file{bar.o}; the file @file{main.o} may be built by running the
@@ -725,8 +725,8 @@ Standard Directory Variables
 
 @opindex --prefix
 
-A user who wishes to install a package on his own account could proceed
-as follows:
+As a user, if you wish to install a package on your own account, you
+could proceed as follows:
 
 @example
 ~/amhello-1.0 % @kbd{./configure --prefix ~/usr}
@@ -1761,7 +1761,7 @@ General Operation
 arbitrary code into the generated @file{Makefile.in}.  For instance,
 the Automake distribution includes a non-standard rule for the
 @code{git-dist} target, which the Automake maintainer uses to make
-distributions from his source control system.
+distributions from the source control system.
 
 @cindex GNU make extensions
 
@@ -10454,7 +10454,7 @@ CVS
 out-of-date file is up-to-date.
 
 For instance, suppose a developer has modified @file{Makefile.am} and
-has rebuilt @file{Makefile.in}.  He then decides to do a last-minute
+has rebuilt @file{Makefile.in}, and then decides to do a last-minute
 change to @file{Makefile.am} right before checking in both files
 (without rebuilding @file{Makefile.in} to account for the change).
 
@@ -11532,10 +11532,10 @@ Hard-Coded Install Paths
 @samp{$(datadir)}, etc.), the effect will be the same:
 user-installations are impossible.
 
-When a (non-root) user wants to install a package, he usually has no
-right to install anything in @file{/usr} or @file{/usr/local}.  So he
-does something like @samp{./configure --prefix ~/usr} to install
-package in his own @file{~/usr} tree.
+As a (non-root) user who wants to install a package, you usually have no
+right to install anything in @file{/usr} or @file{/usr/local}.  So you
+do something like @samp{./configure --prefix ~/usr} to install a
+package in your own @file{~/usr} tree.
 
 If a package attempts to install something to some hard-coded path
 (e.g., @file{/etc/afile}), regardless of this @option{--prefix} setting,
@@ -12552,9 +12552,9 @@ Dependencies As Side Effects
 maude.o: maude.c something.h
 @end example
 
-Now suppose that the developer removes @file{something.h} and updates
-...@file{maude.c} so that this include is no longer needed.  If he runs
-...@command{make}, he will get an error because there is no way to create
+Now suppose that you remove @file{something.h} and update @file{maude.c}
+so that this include is no longer needed.  If you run @command{make},
+you will get an error because there is no way to create
 @file{something.h}.
 
 We fixed this problem in a later release by further massaging the



Update AUTHORS.

2010-06-06 Thread Ralf Wildenhues
I guess it was about time I added this.

Cheers,
Ralf

* AUTHORS: Update.

diff --git a/AUTHORS b/AUTHORS
index f1cd414..e63f8b7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,3 +15,7 @@ Alexandre Oliva
 Alexandre Duret-Lutz
   Major overhaul of everything.
   Maintenance since 2002.
+
+Ralf Wildenhues
+  Random breakage.
+  Maintenance since 2006.



Re: [PATCH] Enable `errexit' shell flag in various tests.

2010-06-06 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Tue, Apr 27, 2010 at 02:33:14PM CEST:
> Here is another simple patch which ought to make the use of the 
> `errexit' shell flag in the testsuite more consistent.  This one affects 
> a larger number of files, but since the changes are all similar and all 
> done in a similar context, this shouldn't be a problem.

This patch is good for maint, thanks!

Cheers,
Ralf

> Enable `errexit' shell flag in various tests.
> 
> * tests/acoutnoq.test: Enabled `errexit' shell flag, and related
> minor changes.
> * tests/acoutpt.test: Likewise.
> * tests/acoutqnl.test: Likewise.
> * tests/amassign.test: Likewise.
> * tests/ansi2.test: Likewise.
> * tests/ansi4.test: Likewise.
> * tests/badprog.test: Likewise.
> * tests/checkall.test: Likewise.
> * tests/clean.test: Likewise.
> * tests/colneq2.test: Likewise.
> * tests/colon.test: Likewise.
> * tests/colon5.test: Likewise.
> * tests/colon6.test: Likewise.
> * tests/comment.test: Likewise.
> * tests/compile_f90_c_cxx.test: Likewise.
> * tests/compile_f_c_cxx.test: Likewise.
> * tests/cond3.test: Likewise.
> * tests/cond6.test: Likewise.
> * tests/cond13.test: Likewise.
> * tests/conf2.test: Likewise.
> * tests/confvar.test: Likewise.
> * tests/confvar2.test: Likewise.
> * tests/cond8.test: Likewise, plus a cosmetic change.
> * tests/confh4.test: Likewise.  Also, add in the heading comments
> an excerpt from the original bug report which motivated the
> creation of this test, to make its purpose clearer.



Re: [PATCH] Enable `errexit' shell flag in all tests cxx*.test.

2010-06-06 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Apr 27, 2010 at 12:40:44PM CEST:
> Here is another simple patch which ought to make the use of the 
> `errexit' shell flag in the testsuite more consistent.

> Enable `errexit' shell flag in all tests cxx*.test.
> 
> * tests/cxx.test: Add call to `set -e'.  Related changes.
> Bumped copyright years.
> * tests/cxxansi.test: Likewise.
> * tests/cxxcpp.test: Likewise.
> * tests/cxxlibobj.test: Likewise.
> * tests/cxxlink.test: Likewise.
> * tests/cxxo.test: Likewise.

This is good for maint, too.  Thanks!



Re: [PATCH] Enable `errexit' shell flag in some test scripts.

2010-06-06 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, May 06, 2010 at 01:45:10PM CEST:
> Enable the `errexit' shell flag in another bunch of test scripts.
> 
> No relevant semantic change should be introduced by the patch, except 
> for the test `discover.test', which has been made slighty stricter 
> w.r.t. the exit status of Automake (a non-zero exit status is 
> expected) and the grepping of the error message produced by Automake.
> Also, some botched/obsoleted comments and some unnecessary code have 
> been removed from scripts `fonly.test' and `f90only.test'.
> 
> The involved test scripts and the modifications done to them are simple 
> enough that no portability problem involving the `errexit' flag should 
> have been introduced.

Not quite right in this case.  OpenBSD sh fails ext.test with your
patch, see my recent post on autoconf-patches which should improve
the autoconf.texi description of this issue.

> From 66b8cc7b37b38f1c05138ce86b6d7a27f53dc3ad Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini 
> Date: Thu, 6 May 2010 13:37:43 +0200
> Subject: [PATCH] Enable `errexit' shell flag in some test scripts.
> 
> * tests/dash.test: Enable `errexit' shell flag, and related
> changes.
> * tests/defun.test: Likewise.
> * tests/defun2.test: Likewise.
> * tests/dejagnu.test: Likewise.
> * tests/double.test: Likewise.
> * tests/distcom2.test: Likewise.
> * tests/empty2.test: Likewise.
> * tests/empty3.test: Likewise.
> * tests/empty4.test: Likewise.
> * tests/flibs.test: Likewise.
> * tests/exdir.test: Likewise.
> * tests/ext.test: Likewise.
> * tests/extra.test: Likewise.
> * tests/extra2.test: Likewise.
> * tests/extra3.test: Likewise.
> * tests/extra4.test: Likewise.
> * tests/fnoc.test: Likewise.
> * tests/fo.test: Likewise.
> * tests/instexec.test: Likewise.
> * tests/ltdeps.test: Likewise.
> * tests/nodep.test: Likewise.
> * tests/nodepcomp.test: Likewise.
> * tests/f90only.test: Likewise, and remove botched/obsoleted
> comments and unecessary commands.
> * tests/fonly.test: Likewise, and removed botched/obsolted
> comments and unecessary commands.
> * tests/discover.test: Likewise, and made stricter.

I'm committing your patch to maint, re-ordering the log entry so
flibs.test is alphabetical again, and committed the following fix
on top.

Note that to be pedantic, the change of the "&& Exit 1" line is not
necessary when adding the second line (because it's only the last
command inside the compound list that is important), but I prefer to
play safe here; it is not nice to have a test fail just because you
reorder two nearby unrelated commands.

Cheers,
Ralf

Improve ext.test semantics, avoid OpenBSD sh errexit issue.

* tests/ext.test: Inside shell compound command, use
`if $cmd; then Exit 1; fi' rather than `$cmd && Exit 1', to
fix failure with OpenBSD sh introduced with last patch.
Actually ensure that a rule for .EXT.o is created for each
known extension EXT.

diff --git a/tests/ext.test b/tests/ext.test
index ef877b0..9340673 100755
--- a/tests/ext.test
+++ b/tests/ext.test
@@ -38,6 +38,7 @@ $AUTOMAKE
 
 for ext in f for f90 f95 F F90 F95 r m upc
 do
-   grep "^$ext\.o:" Makefile.in && Exit 1
+   if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+   grep "^\.$ext\.o:" Makefile.in
 done
 Exit 0



Re: [PATCH] Improve tests link*.test (enable `set -e').

2010-06-06 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sat, May 08, 2010 at 02:29:13AM CEST:
> * tests/link_c_cxx.test: Enable `errexit shell flag, and related
> changes.  Also, do not create useless source files.
> * tests/link_dist.test: Likewise.
> * tests/link_f90_only.test: Likewise.
> * tests/link_f_only.test: Likewise.
> * tests/link_fc.test: Likewise.
> * tests/link_fccxx.test: Likewise.
> * tests/link_fcxx.test: Likewise.

Thanks!  For maint.



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-06 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, Jun 03, 2010 at 02:07:19PM CEST:
> What about the attached new try?  It just complicates the generated 
> tests a little bit, but this is a more than fair tradeoff IMO.

That looks like a better idea to me.  However, 'return' from a script
sourced with '.' is not portable to, e.g., Solaris or Tru64 5.1D sh.
A portable alternative is to wrap the script contents into a
conditional.  I'm amending the patch to do that instead.

> Note that I removed a couple of unrelated changes to defs.in that were 
> in my previous patch, since now I feel they better belong to a 
> different patch series aimed at defs.in refactoring (which I'll submit 
> at a later date).

OK.

Committed like this, and merged to master.  Let's not bother with the
messed-up indentation.

Cheers,
Ralf

2010-06-06  Stefano Lattarini  
Ralf Wildenhues  

Fix distcheck failure with distributed generated parallel tests.
* tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
being different from the value at developer `make dist' time.
* tests/defs.in: Protect against mutiple inclusion, by using ...
($am_defs_included): ... this new variable.
($srcdir): Do not compute, but simply define to `...@abs_srcdir@'
as substituted by configure.
Report, suggestions and first fix by Ralf Wildenhues, final
patch by Stefano Lattarini.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 62ad6aa..e647b03 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,7 +34,10 @@ $(parallel_tests): Makefile.am
{ echo '#!/bin/sh'; \
  echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
  echo 'parallel_tests=yes'; \
- echo ". '$(srcdir)/$$input'"; \
+ echo '. ./defs || Exit 1'; \
+ echo '# So that the sourced test can re-exec ./defs safely.'; \
+ echo 'cd "$$curdir" || Exit 1'; \
+ echo ". \"\$$testsrcdir/$$input\""; \
} > $...@-t
$(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@
 
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 295d259..c7ab9d7 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1380,7 +1380,10 @@ $(parallel_tests): Makefile.am
{ echo '#!/bin/sh'; \
  echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
  echo 'parallel_tests=yes'; \
- echo ". '$(srcdir)/$$input'"; \
+ echo '. ./defs || Exit 1'; \
+ echo '# So that the sourced test can re-exec ./defs safely.'; \
+ echo 'cd "$$curdir" || Exit 1'; \
+ echo ". \"\$$testsrcdir/$$input\""; \
} > $...@-t
$(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@
 
diff --git a/tests/defs.in b/tests/defs.in
index 497b57f..d4c2534 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -2,7 +2,7 @@
 # @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,13 @@
 # Defines for Automake testing environment.
 # Tom Tromey 
 
+# Protect this file against multiple inclusion, useful for generated tests.
+if test x"$am_defs_included" = x"yes"; then
+  : "$me: ./defs already included"
+  cd "$curdir/$testSubDir" || Exit 99
+
+else # not already included
+
 # Be more Bourne compatible.
 # (Snippet copied from configure's initialization in Autoconf 2.64)
 DUALCASE=1; export DUALCASE # for MKS sh
@@ -40,11 +47,7 @@ test -f ./defs || {
exit 1
 }
 
-if test -z "$srcdir"; then
-   # compute $srcdir.
-   srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
-   test "$srcdir" = $0 && srcdir=.
-else :; fi
+srcdir=${srcdir-'@abs_srcdir@'}
 
 # Ensure $srcdir is set correctly.
 test -f "$srcdir/defs.in" || {
@@ -428,7 +431,12 @@ AUTOMAKE_fails ()
   AUTOMAKE_run 1 ${1+"$@"}
 }
 
+# Register that this file has alredy been sourced.
+am_defs_included=yes
+
 # Turn on shell traces.
 set -x
 
 pwd
+
+fi # not already included



More minor message fixes.

2010-06-06 Thread Ralf Wildenhues
This patch picks up a couple more obvious message fixes.
Committing to master.

Cheers,
Ralf

More minor message fixes.

* aclocal.in (scan_file): Fix recommended info command line.
* automake.in (handle_lib_objects): No need to prepend function
name to prog_error message.
(handle_tags): Add missing word and missing space in error
message.
(handle_dist): Add missing closing single quote in message.
Line-wrap one long message for readability.

diff --git a/aclocal.in b/aclocal.in
index 06d69ed..182e4f7 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -559,7 +559,7 @@ sub scan_file ($$$)
  if (! defined $1)
{
  msg ('syntax', "$file:$.", "underquoted definition of $2"
-  . "\n  run info '(automake)Extending aclocal'\n"
+  . "\n  run info Automake 'Extending aclocal'\n"
   . "  or see http://sources.redhat.com/automake/";
   . "automake.html#Extending-aclocal")
unless $underquoted_manual_once;
diff --git a/automake.in b/automake.in
index 05b8711..be336a1 100644
--- a/automake.in
+++ b/automake.in
@@ -2317,9 +2317,9 @@ sub handle_lib_objects
   my ($xname, $varname) = @_;
 
   my $var = var ($varname);
-  prog_error "handle_lib_objects: `$varname' undefined"
+  prog_error "`$varname' undefined"
 unless $var;
-  prog_error "handle_lib_objects: unexpected variable name `$varname'"
+  prog_error "unexpected variable name `$varname'"
 unless $varname =~ /^(.*)(?:LIB|LD)ADD$/;
   my $prefix = $1 || 'AM_';
 
@@ -2352,7 +2352,7 @@ sub handle_lib_objects
   # FIXME: should display a stack of nested variables
   # as context when $var != $subvar.
   err_var ($var, "linker flags such as `$val' belong in "
-   . "`${prefix}LDFLAGS");
+   . "`${prefix}LDFLAGS'");
 }
   return ();
 }
@@ -3822,8 +3822,8 @@ sub handle_tags
set_seen 'TAGS_DEPENDENCIES';
 }
 elsif (reject_var ('TAGS_DEPENDENCIES',
-  "doesn't make sense to define `TAGS_DEPENDENCIES'"
-  . "without\nsources or `ETAGS_ARGS'"))
+  "it doesn't make sense to define `TAGS_DEPENDENCIES'"
+  . " without\nsources or `ETAGS_ARGS'"))
 {
 }
 else
@@ -3946,7 +3946,7 @@ sub handle_dist ()
   $archive_defined ||=
grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip lzma xz);
   error (option 'no-dist-gzip',
-"no-dist-gzip specified but no dist-* specified, "
+"no-dist-gzip specified but no dist-* specified,\n"
 . "at least one archive format must be enabled")
unless $archive_defined;
 }



Re: [PATCH] Enable `errexit' shell flag in some test scripts.

2010-06-06 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, May 06, 2010 at 01:45:10PM CEST:
> No relevant semantic change should be introduced by the patch, except 
> for the test `discover.test', which has been made slighty stricter 
> w.r.t. the exit status of Automake (a non-zero exit status is 
> expected) and the grepping of the error message produced by Automake.

Let's do this change uniformly.  Patch below is for maint.

Cheers,
Ralf

Prefer AUTOMAKE_fails over `$AUTOMAKE | grep' in tests.

* tests/ldadd.test: Enable errexit.  Use AUTOMAKE_fails so
the verbose log contains all output.
* tests/mdate.test: Likewise.
Prompted by Stefano Lattarini's change to discover.test.

diff --git a/tests/ldadd.test b/tests/ldadd.test
index 005f9d8..7f4fce8 100755
--- a/tests/ldadd.test
+++ b/tests/ldadd.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,6 +20,8 @@
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_LIBTOOL
@@ -39,5 +42,6 @@ END
 : > q.c
 
 $ACLOCAL || Exit 1
-$AUTOMAKE 2>&1 | grep LDADD || Exit 1
+AUTOMAKE_fails
+grep LDADD stderr || Exit 1
 Exit 0
diff --git a/tests/mdate.test b/tests/mdate.test
index 704b393..92a736f 100755
--- a/tests/mdate.test
+++ b/tests/mdate.test
@@ -1,5 +1,6 @@
 #!/bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
 END
@@ -31,4 +34,5 @@ END
 : > texinfo.tex
 
 $ACLOCAL || Exit 1
-$AUTOMAKE 2>&1 > /dev/null | grep 'required file.*mdate-sh'
+AUTOMAKE_fails
+grep 'required file.*mdate-sh' stderr



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-06 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Jun 06, 2010 at 07:13:48PM CEST:
> At Sunday 06 June 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Thu, Jun 03, 2010 at 02:07:19PM CEST:
> > > What about the attached new try?  It just complicates the
> > > generated tests a little bit, but this is a more than fair
> > > tradeoff IMO.
> > 
> > That looks like a better idea to me.
> But it doesn't work with tests using e.g. 'required=libtool'  :-(
> For example, pr401b-p.test now fails.  Ouch.
> 
> What about the attached fix?

Almost.  BSD make uses 'sh -ec' to execute rule commands, this one can
fail reasonably.  I'm pushing this amended change instead, and fixing
the comment language while we're at it.

Thanks, and sorry for not having rerun the complete testsuite before
pushing the original patch.

Cheers,
Ralf

2010-06-06  Stefano Lattarini  
Ralf Wildenhues  

Fix error in generation of parallel tests.
* tests/Makefile.am ($(parallel_tests)): Cope with $required
being defined by the source tests, ensuring that it's defined
to the same value in the generated tests; this is *necessary*
to have it correctly recognized and processed by the ./defs
intialization.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index e647b03..340d1f2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -33,9 +33,10 @@ $(parallel_tests): Makefile.am
$(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
{ echo '#!/bin/sh'; \
  echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ if grep "^required=" "$(srcdir)/$$input"; then :; else :; fi; \
  echo 'parallel_tests=yes'; \
  echo '. ./defs || Exit 1'; \
- echo '# So that the sourced test can re-exec ./defs safely.'; \
+ echo '# Allow the sourced test to re-source ./defs safely.'; \
  echo 'cd "$$curdir" || Exit 1'; \
  echo ". \"\$$testsrcdir/$$input\""; \
} > $...@-t



A few more perl code coverage patches

2010-06-06 Thread Ralf Wildenhues
I'm merging a handful of trivial patches increasing coverage of the
Automake perl code, to master.

Cheers,
Ralf

Coverage for aclocal diagnosing underquoted macros.

* tests/acloca23.test: New test.
* tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index f709593..0db7851 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -66,6 +66,7 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+acloca23.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
diff --git a/tests/acloca23.test b/tests/acloca23.test
new file mode 100755
index 000..1741e70
--- /dev/null
+++ b/tests/acloca23.test
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Ensure we diagnose underquoted AC_DEFUN's.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+FOO
+END
+
+mkdir m4
+cat >m4/foo.m4 &2; Exit 1; }
+cat stderr >&2
+grep 'underquoted definition.*FOO' stderr
+grep 'warning.*warning' stderr && Exit 1
+
+:


Testsuite coverage for bogus macro file serial numbers.

* tests/acloca18.test: Also test ill-formed serial numbers
and serial numbers after macro definitions.

diff --git a/tests/acloca18.test b/tests/acloca18.test
index 276e5ba..6f2de7e 100755
--- a/tests/acloca18.test
+++ b/tests/acloca18.test
@@ -25,7 +25,7 @@ AM_MACRO1
 AM_MACRO2
 END
 
-mkdir 1 2 3 4
+mkdir 1 2 3 4 5 6
 
 cat >1/m1.m4 <4/mumble.m4 <> foo])
 EOF
 
+cat >5/ill-formed.m4 <> foo])
+EOF
+
+cat >6/after-def.m4 <> foo])
+#serial 1
+EOF
 
 ACLOCAL_TESTSUITE_FLAGS='-I 1 -I 2 -I 3 -I 4'
 
@@ -112,3 +123,9 @@ cat output
 grep '#serial 456' output
 test ! -f 4/m1.m4
 grep 'installing.*4/m1.m4' stderr
+
+$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
+test `grep -c 'ill-formed serial' stderr` -eq 3
+
+$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
+grep 'serial.*before any macro definition' stderr



Coverage for use of anachronistic variables.

* tests/oldvars.test: New test.
* tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0db7851..2a46750 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -518,6 +518,7 @@ number.test \
 objc.test \
 objc2.test \
 obsolete.test \
+oldvars.test \
 order.test \
 outdir.test \
 output.test \
diff --git a/tests/oldvars.test b/tests/oldvars.test
new file mode 100755
index 000..7a2bb71
--- /dev/null
+++ b/tests/oldvars.test
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Use of these variables is deprecated:
+# LISP, HEADERS, DATA, SCRIPTS, LTLIBRARIES, LIBRARIES, PROGRAMS, MANS.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >Makefile.am <<\EOF
+DATA =
+HEADERS =
+LIBRARIES =
+LISP =
+LTLIBRARIES =
+MANS =
+PROGRAMS =
+SCRIPTS =
+EOF
+
+$ACLOCAL
+AUTOMAKE_fails
+test `grep -c anachronism stderr` -eq 8



Coverage for TAGS_DEPENDENCIES warning.

* tests/tags2.test: New test.
* tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2a46750..361294b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -711,6 +711,7 @@ symlink2.test \
 symlink3.test \
 syntax.test \
 tags.test \
+tags2.test \
 tagsub.test \
 tar.test \
 tar2.test \
diff --git a/tests/tags2.test b/tests/tags2.test
new file mode 100755
index 000..f6e018c
--- /dev/null
+++ b/tests/tags2.test
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#

Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-06 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Jun 06, 2010 at 07:50:57PM CEST:
> At Sunday 06 June 2010, Ralf Wildenhues wrote:
> > 
> > Thanks, and sorry for not having rerun the complete testsuite
> >  before pushing the original patch.
> Well, I should say "sorry" for not having tested the patch thoroughly.

The patch is still not right, so I'm not pushing it.  A generated test
foo-p.test now needs to depend upon foo.test, this is not reflected in
the makefile.

Either we rewrite defs.in so that it is idempotent and sourced twice,
or sets only the needed variables the first time it is sourced.
Alternatively, it seems viable to just revert this patch mini series
un-aply titled "bikeshedding" in the first place.  ;-)

Cheers,
Ralf



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-07 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Jun 06, 2010 at 10:00:23PM CEST:
> At Sunday 06 June 2010, Ralf Wildenhues wrote:
> > 
> > The patch is still not right, so I'm not pushing it.  A generated
> >  test foo-p.test now needs to depend upon foo.test,
> >  this is not reflected in the makefile.
> Right  :-(

And really I'd prefer if foo-p.test would not depend upon foo.test.

> Not however that the older makefile didn't have a much better handling
> of tests' dependencies.

Well, we came from non-parallel tests, where recheck and RECHECK_LOGS
did not exist, so all you could do to limit testings was to set TESTS
explicitly.  There, you set check_SCRIPTS/check_PROGRAMS for a global
set of dependencies and would be done with it.  The Automake package
still reflects this to some point.  And really, the check_SCRIPTS are
in a way global dependencies to all tests.

> Maybe the pending patch of mine "Improve
> declaration of dependencies in the testsuite" might help here, if
> properly extended.  For reference:
>  <http://lists.gnu.org/archive/html/automake-patches/2010-05/msg00012.html>

This looks interesting.  Lemme see ...

> > Either we rewrite defs.in so that it is idempotent and sourced
> > twice,
> Mhh... that would entail a rethinking of the whole 'required=...' stuff.
> Which wouldn't be bad in the long run, but we should think thoroughly
> before venturing down that road, to get the interface right this time.

Well, the *-p.test could set something like am_skip_defs which then
would pretty much set testsrcdir and curdir only, and then unset
am_skip_defs, so the defs sourcing of *.test is full, WDYT?

Cheers,
Ralf



Re: [PATCH] Improve declaration of dependencies in the testsuite.

2010-06-07 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Sat, May 08, 2010 at 03:07:34AM CEST:
> * tests/Makefile.am: Declare all the testsuite logs as dependent
> from `defs', since all test scripts include ./defs.
> * test/gen-parallel-tests:  Generate declaration of dependecy for
> each `foo-p.log' from the corresponding `foo.test', since each
> `foo-t.test' script sources the corresponding `foo.test'.

Ah, good observation.  Yes, I think we want something like this for a
better `make check RECHECK_LOGS=' experience.

However, for completeness we should depend on all check_SCRIPTS in this
directory.  (To be very pedantic, test results depend on many more files
in the Automake tree, but I don't want to sort these things out, and
these dependencies would not allow for more laziness in execution.)
This allows to remove check_SCRIPTS, which saves one more sub-make.  :-)

I've gone a bit over your patch and am committing the following variant
(to master only).

Thanks,
Ralf

2010-06-07  Stefano Lattarini  
Ralf Wildenhues  

Improve declaration of dependencies in the testsuite.
* tests/Makefile.am (check_SCRIPTS): Remove.  Instead, let ...
($(TEST_LOGS)): ... all test logs depend on the scripts.
* test/gen-parallel-tests: For each parallel test foo-p.test,
let `foo-p.log' also depend on `foo.test', since it is sourced.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 361294b..2fe615c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -795,7 +795,7 @@ $(parallel_tests)
 EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
 
 # Each test case depends on defs, aclocal, and automake.
-check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
+$(TEST_LOGS): defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
 clean-local: clean-local-check
 .PHONY: clean-local-check
diff --git a/tests/gen-parallel-tests b/tests/gen-parallel-tests
index 39f5d1e..d2a5c13 100755
--- a/tests/gen-parallel-tests
+++ b/tests/gen-parallel-tests
@@ -35,8 +35,18 @@ while read tst; do
  || grep "parallel_tests=['\"]yes" $tst >/dev/null
   then :; else echo $tst; fi;
 done |
+sed -e 's/\.test$//' |
 {
   echo "## Generated by gen-parallel-tests.  Edit Makefile.am instead of this."
-  echo "parallel_tests = \\"
-  sed 's,\.test$,-p.test,; $!s,$, \\,'
+  echo "parallel_tests ="
+  # Since `foo-p.test' sources `foo.test', `foo-p.log' also depends on
+  # `foo.test'.
+  sed -e '
+h
+s/^/parallel_tests += /
+s/$/-p.test/
+p
+x
+s/.*/&-p.log: &.test/
+  '
 }



Re: [PATCH] Improve declaration of dependencies in the testsuite.

2010-06-08 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Mon, Jun 07, 2010 at 11:23:23PM CEST:
>   Improve declaration of dependencies in the testsuite.
>   * tests/Makefile.am (check_SCRIPTS): Remove.  Instead, let ...
>   ($(TEST_LOGS)): ... all test logs depend on the scripts.
>   * test/gen-parallel-tests: For each parallel test foo-p.test,
>   let `foo-p.log' also depend on `foo.test', since it is sourced.

Hmpf.  There is a practical downside to this.  When working on defs.in,
I would often quickly like to see if my changes improved things.  Before
this patch, and assuming that my change didn't introduce regressions,
a quick check was possible with
  make recheck  # retry all failed tests
  make check RECHECK_LOGS=  # try all yet-untried tests

With this patch, the second command will rerun all tests.  Sure, before
I push a patch, the latter is the right thing to do, but during testing,
it can be a bit annoying.

Still, we are advocating this approach, and I still think that it is
the right thing for files that only a subset of tests depend upon;
eating our own dog food serves us right.

I wonder why I can't use
  gmake --assume-old=defs check RECHECK_LOGS=

to work around this, though.  Must be due to the make recursions.

Cheers,
Ralf



Re: [PATCH] Enable `errexit' shell flag in some test scripts.

2010-06-08 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Tue, Jun 08, 2010 at 04:20:39PM CEST:
> Another patch to make the use of the `errexit' shell flag in the 
> testsuite more uniform.

Thanks!  For maint.

> Enable `errexit' shell flag in some test scripts.
> 
> * tests/subcond.test: Enabled `errexit' shell flag, and related
> minor changes.
> * tests/subst.test: Likewise.
> * tests/tags.test: Likewise.
> * tests/unused.test: Likewise.
> * tests/vars.test: Likewise.
> * tests/version4.test: Likewise.
> * tests/vpath.test: Likewise.
> * tests/vtexi2.test: Likewise.
> * tests/werror.test: Likewise.
> * tests/whoami.test: Likewise.
> * tests/acsilent.test: Likewise, and don't use a command
> substitution that can be easily avoided.
> * tests/version.test: Enabled `errexit' shell flag, and related
> minor changes.  Also, avoid deprecated constructs in the generated
> `configure.in'.
> * tests/version2.test: Likewise.

> --- a/tests/acsilent.test
> +++ b/tests/acsilent.test

> -$ACLOCAL > output 2>&1 || { cat output; Exit 1; }
> -test -z "`cat output`"
> +$ACLOCAL >output 2>&1 || { cat output; Exit 1; }

Do you do these changes with a script?  If not, then why such whitespace
changes?  It's not like there is any consistency in spacing there in the
current code.  (I'm asking because I actually had to look three times to
ensure I didn't overlook a non-whitespace change.)

> +cat output
> +test ! -s output

Cheers,
Ralf



Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.

2010-06-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Jun 08, 2010 at 01:31:00AM CEST:
> At Monday 07 June 2010, Ralf Wildenhues  wrote:

BTW, is gmail configurable to not quote the email address in the tag
line?  Not that I realistically expect any spammer to not have mine,
but it also causes the line to be overly long a lot of the time.

> > Well, the *-p.test could set something like am_skip_defs which then
> > would pretty much set testsrcdir and curdir only, and then unset
> > am_skip_defs, so the defs sourcing of *.test is full, WDYT?
> Sounds reasonable.  I've amended the patch to do that.
> Let me know what you think about it.

It would be good to know if and how you tested a patch you post.  Yes,
granted, I'm guilty of omitting this bit of information myself more
often than is warranted ... ;-)

Anyway, this fails auxdir.test and others, because testsrcdir isn't
absolute.

I'm committing the following variant below, and merging to master.
In the spirit of VPATH, the patch prefers a test in the build tree over
one in the source tree.  I have tested the patch with a full distcheck,
a full check in a VPATH and non-VPATH build, and by invoking both
generated and non-generated tests manually (without make), from a VPATH
and a non-VPATH build directory.

> I also think that, in the long run, it would be advisable to split
> `tests/defs.in' into two files:
> 
>   * a stripped-down `tests/defs.in', containing *just definitions*, and
> which is AC_SUBST'd to create a file `tests/defs.sh' which is truly
> idempotent if sourced multiple times; and
> 
>   * a new, unprocessed file `tests/test-init.sh', which in turn sources
> `tests/defs.sh', and contains the bulk of the current `tests/defs'
> (definition of shell functions, analysis/processing of $required,
> creation of test-subdir, setting of exit trap, etc.)
> 
> This change would ideally be the culminating point of a `tests/defs'
> refactoring patch series I'm writing.  For the moment, however, I'd
> apply the less obtrusive patch written following your suggestions
> (which is attached).

I don't see why it would be necessary to split the defs file further.
OTOH, if there are bits of the gnulib test initialization machinery we
can profit from, that might be valuable in the long run.

Thanks,
Ralf

2010-06-08  Stefano Lattarini  
Ralf Wildenhues  

Fix error in generation of parallel tests.
* tests/defs.in ($am_skip_defs): New variable, to be used when
./defs must be sourced multiple times.  If set, unset it and
only define $srcdir; otherwise, also go through the rest of
the script.
($am_defs_included): Remove, no more needed.
* tests/Makefile.am ($(parallel_tests)): Update accordingly,
using only $srcdir from defs.
Fixes potential test failures of tests that use $required.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index e647b03..7eea801 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,12 +32,20 @@ $(parallel_tests): Makefile.am
$(AM_V_at)rm -f $@ $...@-t
$(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
{ echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
+ echo; \
+ echo '# Ensure proper definition of $$srcdir.'; \
+ echo 'am_skip_defs=yes'; \
+ echo '. ./defs || exit 99'; \
+ echo 'test -n "$$srcdir" || exit 99 # sanity check'; \
+ echo; \
+ echo "# Run the test with Automake's parallel-tests driver enabled."; 
\
  echo 'parallel_tests=yes'; \
- echo '. ./defs || Exit 1'; \
- echo '# So that the sourced test can re-exec ./defs safely.'; \
- echo 'cd "$$curdir" || Exit 1'; \
- echo ". \"\$$testsrcdir/$$input\""; \
+ echo "if test -f \"./$$input\"; then"; \
+ echo "  . \"./$$input\""; \
+ echo 'else'; \
+ echo "  . \"\$$srcdir/$$input\""; \
+ echo 'fi'; \
} > $...@-t
$(AM_V_at)chmod a+rx $...@-t && mv -f $...@-t $@
 
diff --git a/tests/defs.in b/tests/defs.in
index 72e9d52..fb056ff 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -20,12 +20,14 @@
 # Defines for Automake testing environment.
 # Tom Tromey 
 
+# Absolutely necessary variable(s).
+srcdir=${srcdir-'@abs_srcdir@'}
+
 # Protect this file against multiple inclusion, useful for generated tests.
-if test x"$am_defs_included" = xyes; then
-  : "$me: ./defs already included"
- 

Re: [PATCH] Make test `ammissing.test' stricter.

2010-06-09 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Jun 06, 2010 at 09:30:36PM CEST:
> * tests/ammissing.test: Fail if $ACLOCAL succeds unexpectedly.
> Enable `errexit' shell flag. 

Thanks!  For maint.



Re: [PATCH] Modernize, improve and/or fix various test scripts.

2010-06-09 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Sat, May 08, 2010 at 01:46:46AM CEST:
> This seems huge, but most changes are trivial and/or similar.
> And having all these tweakings packed in a big lump should make their 
> reviewing easier IMHO (at least, it shouldn't make it more difficult).

> Modernize, improve and/or fix various test scripts.
> 
> * tests/sanity.test: Rely on the `configure.in' stub created by
> `./defs', rather than writing one from scratch.
> * tests/depend2.test: Likewise.  Also, call `set -e' just after
> the inclusion of `./defs', instead that later in the script.
> * tests/canon5.test: Avoid a useless `|| Exit 1' after a call to
> $AUTOMAKE, and improve the positioning of an $ACLOCAL call.
> * tests/exeext4.test: Use $FGREP instead of grep, where possible.
> Make auxiliary rules in the generated Makefile more silent.
> These changes make some checks slighty stricter.
> * tests/ext2.test: Call `Exit 1' if inclusion of `./defs' fails.
> * tests/gettext2.test: Place final `:' at the end of the script,
> rather than in the middle.
> * tests/exeext.test: Call `set -e' just after the inclusion of
> `./defs', instead that later in the script.
> * tests/extra5.test: Likewise.
> * tests/confdeps.test: Likewise.  Also, prefer `mv -f' over
> plain `mv', just to be sure.
> * tests/depcomp.test: Enable `errexit' shell flag, with related
> changes.  Also, modernize the generated configure.in.
> * tests/cond9.test: Likewise.  Also, rely on the `configure.in'
> stub created by `./defs', rather than writing one from scratch.
> * tests/cond10.test: Likewise.
> * tests/depcomp2.test: Likewise.
> * tests/depend3.test: Likewise.
> * tests/distcom7.test: Likewise.
> * tests/fortdep.test: Likewise.  Also, remove definition of
> AUTOMAKE_OPTIONS to `foreign' in the generated Makefile.am,
> since that flag is already provided by $AUTOMAKE.
> * tests/mdate.test: Made stricter, by checking that Automake
> actually failed, and by making a stricter grep on the error
> message.  Also, set shell `errexit flag'.
> * tests/python2.test: Improved verbose messages.

Thanks!  For maint, with this shamelessly squashed in.

Cheers,
Ralf

diff --git a/tests/sanity.test b/tests/sanity.test
index 8416976..ed7fe28 100755
--- a/tests/sanity.test
+++ b/tests/sanity.test
@@ -32,14 +32,14 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr
+cat stderr >&2
 grep 'unsafe absolute working directory' stderr
 
 cd ..
 mkdir build
 cd build
 ../unsafe$/configure 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr
+cat stderr >&2
 grep 'unsafe srcdir' stderr
 
 :



Re: [PATCH] Minor improvements in bootstrap script.

2010-06-10 Thread Ralf Wildenhues
Hi Stefano,

* Stefano Lattarini wrote on Thu, Jun 10, 2010 at 03:15:39PM CEST:
> Well, after having read your considerations, I'm no more OK with the 
> patch myself; maybe I'll amend it later, to keep just the spacing and 
> comsetic changes, and adding a comment about the reason we can't 
> assume existence of /bin/sh.
> 
> But... I note that autoconf-generated configure scripts determine PATH 
> separator in (more or less)  the same way my pached bootstrap script 
> does:
[...]
> If we assume autoconf is correct, I think that it would be better to 
> just copy this code snippet in the bootstrap script.

Yes.  The changes are ok if you split the patch into one purely without
semantic changes, and the rest (so that we don't need to revert the
former when the latter turns out to be bad); and for setting the PATH
separator, please use the code from Autoconf.  Bonus points for
lower-casing the first words in error messages and prepending (pre-set)
`$me: '.  ;-)

Thanks,
Ralf




  1   2   3   4   5   6   7   8   9   10   >