Re: [PATCH] conditional info_TEXINFOS, updated

2007-03-29 Thread Ralf Wildenhues
Hi Paolo,

Thanks for your work on this, and apologies for the delay.

* Paolo Bonzini wrote on Mon, Mar 12, 2007 at 06:36:33PM CET:
> Ok, here's the patch I sent a month ago together with new
> testcases.

Hmm.  Normal TEXINFOS are distributed by default (even their .info files
are).  It strikes me a bit odd not to distribute conditional TEXINFOS
then: the condition could be depending on user wish (say, configure
option).  So it would make sense to distribute conditional TEXINFOS as
well, and only not distribute nodist_info_TEXINFOS (conditional or not).

But then I'm not so sure any more where the info files should be built:
in the source tree or the build tree?  (Is a notion of generated info
files needed?  Probably not, but the longish comment in
handle_texinfo_helper has quite something to digest)

More, should dvi, pdf, ps, html targets build from all or only the
conditioned TEXINFOS?  Right now all will be tried, but since the texi
files aren't distributed, distcheck will fail.

At the end is an expanded, but unfinished test file that exposes a
couple of these questions.  Also, find a patch nit below.

The more I think about this, the more it looks like this belongs in HEAD
rather than branch-1-10, too: it's a new feature, IMVHO.

Cheers,
Ralf

> 2007-03-12  Paolo Bonzini  <[EMAIL PROTECTED]>
> 
>   * automake.in (output_texinfo_build_rules): Add COND parameter.
>   Emit INFO_DEPS and TEXINFOS.
>   (handle_texinfo_helper): Remove references to dead variable
>   info_deps_list.  Collect conditions for info_texinfos files and
>   pass it to output_texinfo_build_rules.  Don't emit TEXINFOS.
>   (append_pretty_variable): New.
>   (push_dist_common): Use it.
>   * automake.in (output_texinfo_build_rules): Add COND parameter.
>   * lib/am/texibuild.am (INFODEPS): Don't emit it.
>   * tests/Makefile.am (TESTS): Add condinfo.test.
>   * tests/condinfo.test: New test.

> Index: automake.in
> ===
> RCS file: /sources/automake/automake/automake.in,v
> retrieving revision 1.1641
> diff -u -p -r1.1641 automake.in
> --- automake.in   16 Oct 2006 05:24:17 -  1.1641
> +++ automake.in   12 Mar 2007 17:35:10 -

> @@ -5859,6 +5874,21 @@ sub cond_stack_endif ($$$)
>  ##  ##
>  
>  
> +# &append_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
> +# -

This is similar to define_pretty_variable, so IMVHO it should be
described as that plus differences; that's more concise.

> +# Like define_variable, but the value is a list, and the variable may
> +# be defined conditionally.  The second argument is the Condition
> +# under which the value should be defined; this should be the empty
> +# string to define the variable unconditionally.  The third argument
> +# is a list holding the values to use for the variable.  The value is
> +# pretty printed in the output file.  Can be invoked multiple times.
> +sub append_pretty_variable ($$$@)
> +{
> +my ($var, $cond, $where, @value) = @_;
> +Automake::Variable::define ($var, VAR_AUTOMAKE, '+', $cond, "@value",
> + '', $where, VAR_PRETTY);
> +}
> +
>  # &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
>  # -
>  # Like define_variable, but the value is a list, and the variable may


--- snip tests/condinfo.test ---
#! /bin/sh
# Copyright (C) 2007  Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# GNU Automake 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.
#
# GNU Automake 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 Automake; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

# Test conditional info_TEXINFOS.
required='makeinfo tex texi2dvi-o'
. ./defs || exit 1

cat >> configure.in << 'END'
AM_CONDITIONAL([NO], [test yes = "$buildalltexis"])
AM_CONDITIONAL([YES], [true])
AC_OUTPUT
END

cat > Makefile.am << 'END'
info_TEXINFOS =
nodist_info_TEXINFOS =
if YES
info_TEXINFOS += baz.texi
endif
if NO
info_TEXINFOS += foo.texi
endif
if YES
info_TEXINFOS += bar.texi
endif
if NO
nodist_info_TEXINFOS += absent.texi
endif
END

cat >foo.texi <<'END'
\input texinfo
@setfilename foo.info
@settitle foo
@node Top
This should not be generated.
@bye
END

cat >bar.texi <<'END'
\input texinfo
@setfilename bar.info
@settitle bar
@node Top
This should be generated.
@bye
END

c

Re: mdate-sh vs. evil user/group names

2007-03-29 Thread Ralf Wildenhues
* Eric Blake wrote on Wed, Mar 28, 2007 at 06:41:03PM CEST:
> Ralf Wildenhues  gmx.de> writes:
> > 
> > It would be even better if it came with a test to ensure correct
> > functioning of the script, as far as portably possible.  For example,
> > it could test that three words are output, and that day and year are
> > numeric.  (As usual, I can write the test, but if you do it, then it
> > will be done more quickly 
> 
> I'll see what I can come up with, but it may be a few days before I have time 
> to focus on it (I'm about to head out of town for the weekend).

Don't worry; FWIW, I'm about to be off soon as well.  I committed the
patch below to HEAD and branch-1-10.  Could you (or somebody else)
please make sure that the new test exposes the bug that was fixed, on
your Cygwin?  Thanks.

Cheers,
Ralf

2007-03-30  Eric Blake  <[EMAIL PROTECTED]>
Ralf Wildenhues  <[EMAIL PROTECTED]>

* lib/mdate-sh (ls_command): Use -n when available to avoid
problems with spaces in user/group names.
* tests/mdate5.test: New test.
* tests/Makefile.am: Adjust.

Index: lib/mdate-sh
===
RCS file: /cvs/automake/automake/lib/mdate-sh,v
retrieving revision 1.18
diff -u -r1.18 mdate-sh
--- lib/mdate-sh29 Jun 2005 20:29:24 -  1.18
+++ lib/mdate-sh29 Mar 2007 23:22:15 -
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2005-06-29.22
+scriptversion=2007-03-30.02
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
+# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software
 # Foundation, Inc.
 # written by Ulrich Drepper <[EMAIL PROTECTED]>, June 1995
 #
@@ -75,6 +75,10 @@
 else
   ls_command='ls -l -d'
 fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+  ls_command="$ls_command -n"
+fi
 
 # A `ls -l' line looks as follows on OS/2.
 #  drwxrwx---0 Aug 11  2001 foo
@@ -89,7 +93,7 @@
 # words should be skipped to get the date.
 
 # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`ls -l -d /`
+set x`$ls_command /`
 
 # Find which argument is the month.
 month=
Index: tests/Makefile.am
===
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.620
diff -u -r1.620 Makefile.am
--- tests/Makefile.am   29 Mar 2007 23:02:05 -  1.620
+++ tests/Makefile.am   29 Mar 2007 23:22:15 -
@@ -367,6 +367,7 @@
 mdate2.test \
 mdate3.test \
 mdate4.test \
+mdate5.test \
 missing.test \
 missing2.test \
 missing3.test \
--- /dev/null   2007-03-24 19:16:22.324321248 +0100
+++ tests/mdate5.test   2007-03-30 01:23:22.0 +0200
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002, 2004, 2007  Free Software Foundation,
+# Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test to make sure mdate-sh works correctly.
+
+. ./defs || exit 1
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = textutils.texi
+END
+
+cat > textutils.texi << 'END'
[EMAIL PROTECTED] version.texi
[EMAIL PROTECTED] textutils.info
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+set x `$SHELL ./mdate-sh Makefile.am`
+shift
+# Check that mdate output looks like a date:
+test $# = 3
+case $1$3 in *[!0-9]*) exit 1;; esac
+test $1 -lt 32




Re: problem with a test that is expected to fail, on cygwin only...

2007-03-29 Thread Ralf Wildenhues
[ http://lists.gnu.org/archive/html/automake-patches/2007-01/msg5.html ]

* Ralf Wildenhues wrote on Thu, Jan 18, 2007 at 10:22:28PM CET:
> * Ed Hartnett wrote on Tue, Jan 16, 2007 at 03:17:00AM CET:
> > 
> > I am having a problem on cygwin only. 
> > 
> > I have a test which is expected to fail. In the Makefile.am I have
> > this:

I have applied this patch now.

Cheers,
Ralf

> 2007-01-18  Ralf Wildenhues  <[EMAIL PROTECTED]>
> 
>   * automake.in (handle_tests): Rewrite XFAIL_TESTS just like
>   TESTS, appending $(EXEEXT), so that matching continues to work
>   on w32.
>   * NEWS: Mention this.
>   * doc/automake.texi (EXEEXT, Extending): Update.
>   * tests/check7.test: New test.
>   * tests/Makefile.am: Adjust.
>   Bug report by Ed Hartnett.




Re: no .deps directory generated

2007-03-29 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Mon, Jan 08, 2007 at 08:46:06PM CET:
> > > * David Byron wrote on Mon, Jan 08, 2007 at 07:40:02PM CET:
> [...]
> > > > 
> > > > AC_CONFIG_FILES([Makefile util/Makefile
> > > > util/tests/Makefile:config/cppunit.mk.in:util/tests/Makefile.in
> > > > testmain/Makefile])

> Darn, this looks like a regression of 1.10 over 1.9.6, due to the
>   sed 10q
> 
> in m4/depout.m4: because cppunit.mk is longer than 10 lines, it won't
> get to the "generated by automake" line any more.

I've applied this patch to HEAD and branch-1-10 now, and added David to
THANKS.

Cheers,
Ralf

* m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Again search
the whole file, but use sed to reduce the line length.
Fixes 1.10 regression.  Report by David Byron.
* THANKS, NEWS: Update.

Index: NEWS
===
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.324
diff -u -r1.324 NEWS
--- NEWS28 Mar 2007 23:08:05 -  1.324
+++ NEWS29 Mar 2007 22:39:30 -
@@ -20,6 +20,11 @@
 * Long standing bugs:
 
   - Fix aix dependency tracking for libtool objects.
+
+* Bugs introduced by 1.10:
+
+  - Fix output of dummy dependency files in presence of post-processed
+Makefile.in's again, but also cope with long lines.
 
 New in 1.10:
 
Index: m4/depout.m4
===
RCS file: /cvs/automake/automake/m4/depout.m4,v
retrieving revision 1.19
diff -u -r1.19 depout.m4
--- m4/depout.m46 Jun 2006 20:39:22 -   1.19
+++ m4/depout.m429 Mar 2007 22:39:31 -
@@ -22,7 +22,7 @@
   # each Makefile.in and add a new line on top of each file to say so.
   # Grep'ing the whole file is not good either: AIX grep has a line
   # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 
2>&1; then
 dirpart=`AS_DIRNAME("$mf")`
   else
 continue




RE: mdate-sh borks on uid/gid containing a space

2007-03-29 Thread Dave Korn
On 29 March 2007 16:27, Stepan Kasal wrote:

> Hello again,
> 
> On Thu, Mar 29, 2007 at 04:12:11PM +0100, Dave Korn wrote:
>> On 29 March 2007 15:38, Stepan Kasal wrote:
>>> On Thu, Mar 29, 2007 at 12:40:12AM +0100, Dave Korn wrote:
 On 29 March 2007 00:26, Ralf Wildenhues wrote:
>

> Eric's patch seems to indicate that line 92 needs changed, too.
> [...]
>>> So it is safer to use -n with ls /, too.
>> 
>>   Umm, yes, that's true, but not relevant; what I was pointing out is that
>> the -n gets added to the $ls_command variable, so it would already be
>> included in the command invoked on line 92, and if you take a second look
>> at the patch, you'll notice that the change to line 92 isn't about adding
>> -n, it's about taking away -l and -d.
> 
> I took a second look, and it did not help:
> 
> @@ -89,7 +93,7 @@
>  # words should be skipped to get the date.
> 
>  # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x"
> below.
> -set x`ls -l -d /`
> +set x`$ls_command /`

  Gah, I overlooked that the original version wasn't using ls_command in the
first place.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today





Re: mdate-sh borks on uid/gid containing a space

2007-03-29 Thread Stepan Kasal
Hello again,

On Thu, Mar 29, 2007 at 04:12:11PM +0100, Dave Korn wrote:
> On 29 March 2007 15:38, Stepan Kasal wrote:
> > On Thu, Mar 29, 2007 at 12:40:12AM +0100, Dave Korn wrote:
> >> On 29 March 2007 00:26, Ralf Wildenhues wrote:
> >>> 
> >>> Eric's patch seems to indicate that line 92 needs changed, too.
[...]
> > So it is safer to use -n with ls /, too.
> 
>   Umm, yes, that's true, but not relevant; what I was pointing out is that the
> -n gets added to the $ls_command variable, so it would already be included in
> the command invoked on line 92, and if you take a second look at the patch,
> you'll notice that the change to line 92 isn't about adding -n, it's about
> taking away -l and -d.

I took a second look, and it did not help:

@@ -89,7 +93,7 @@
 # words should be skipped to get the date.

 # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`ls -l -d /`
+set x`$ls_command /`

 # Find which argument is the month.
 month=

Cheers,
Stepan




RE: mdate-sh borks on uid/gid containing a space

2007-03-29 Thread Dave Korn
On 29 March 2007 15:38, Stepan Kasal wrote:

> Hello,
> 
> On Thu, Mar 29, 2007 at 12:40:12AM +0100, Dave Korn wrote:
>> On 29 March 2007 00:26, Ralf Wildenhues wrote:
>>

>>> Eric's patch seems to indicate that line 92 needs changed, too.
>>> (I haven't tested any on w32.)
>> 
>>   I don't quite understand that myself; ISTM that having -n in $ls_command
>> should do the job for both cases.
> 
> A wild guess:
> 
> Though the current situation is this (quoting Eric):
> 
> $ \ls -ld /
> drwxrwx---+ 14 eblake Users 0 Feb  2 07:58 /
> $ \ls -lLd doc/m4.texinfo
> -rw-r--r-- 1 eblake Domain Users 221922 Mar  1 14:50 doc/m4.texinfo
> 
> it might be possible that even the user or group owner of / would
> have a blank it its name.  (With Cygwin, one never knows.)
> 
> So it is safer to use -n with ls /, too.

  Umm, yes, that's true, but not relevant; what I was pointing out is that the
-n gets added to the $ls_command variable, so it would already be included in
the command invoked on line 92, and if you take a second look at the patch,
you'll notice that the change to line 92 isn't about adding -n, it's about
taking away -l and -d.

  Ah, hang on, now I see why; those flags are /also/ already included in
$ls_command, so they're superfluous on line 92; it's just a minor tidy up.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today





Re: mdate-sh borks on uid/gid containing a space

2007-03-29 Thread Stepan Kasal
Hello,

On Thu, Mar 29, 2007 at 12:40:12AM +0100, Dave Korn wrote:
> On 29 March 2007 00:26, Ralf Wildenhues wrote:
> 
> > Eric's patch seems to indicate that line 92 needs changed, too.
> > (I haven't tested any on w32.)
> 
>   I don't quite understand that myself; ISTM that having -n in $ls_command
> should do the job for both cases.

A wild guess:

Though the current situation is this (quoting Eric):

$ \ls -ld /
drwxrwx---+ 14 eblake Users 0 Feb  2 07:58 /
$ \ls -lLd doc/m4.texinfo
-rw-r--r-- 1 eblake Domain Users 221922 Mar  1 14:50 doc/m4.texinfo

it might be possible that even the user or group owner of / would
have a blank it its name.  (With Cygwin, one never knows.)

So it is safer to use -n with ls /, too.

Just guessing, I'm not a Cygwin user.

Stepan Kasal