Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Paolo Bonzini
On 10/29/2009 10:46 PM, Ludovic Courtès wrote: > > #! /bin/sh > eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' > if 0; > > suggested in perlrun(1)? > > Actually that doesn’t work: Looks like a typo, further down in perlrun(1) there is #!/usr/bin/perl eval 'e

Re: mkdir vs. GPL

2009-10-29 Thread Eric Blake
Jim Meyering meyering.net> writes: > > [3/5] dirname-lgpl: adjust clients that don't need full dirname > > Fallout from the split. In particular, test-mkdir and test-rename no longer > > need libintl. Meanwhile, openat and friends no longer drag in dirname, but > > still drag in xalloc du

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Here's a patch. Likewise, ‘pmccabe2html’ assumes /usr/bin/awk, but I’m not sure what to do here: - ‘gl_PMCCABE2HTML’ does ‘AC_PROG_AWK’, so we could substitute @AWK@ in there. - OTOH, ‘pmccabe2html’ is typically a maintainer script, so I’d rather remove ‘AC_PROG_AWK’ and do something

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Paolo Bonzini writes: > Yeah. But why not the standard > > #! /bin/sh > eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' > if 0; > > suggested in perlrun(1)? Actually that doesn’t work: --8<---cut here---start->8--- $ ./build-aux/gitlog-to-changelog /bin/sh:

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Hi Karl, k...@freefriends.org (Karl Berry) writes: > -#!/usr/bin/perl > +#!/bin/sh > > Just to mention that an alternative would be #!/usr/bin/env perl. It won’t work on NixOS, which doesn’t have /usr/bin. (On NixOS, the only “standard” path that can be relied on is /bin/sh.) Thanks, L

Re: avoid some warnings in tests

2009-10-29 Thread Eric Blake
Simon Josefsson josefsson.org> writes: > > In coreutils, I turned on gcc warnings for the gnulib unit tests. This > > cleans up the modules that are mainly from Jim and myself, and mostly hits > > places that used 'main ()' or did 'char *foo = "str"'. Simon and Bruno > > had the most other test

Re: mkdir vs. GPL

2009-10-29 Thread Eric Blake
Jim Meyering meyering.net> writes: > > > > Still to go - LGPL argp still depends on the GPL dirname module, because it > > uses base_name (which xmallocs). I can switch it to use last_component > > instead, but will have to audit all clients that used __argp_dir_name to ensure > > they are stil

Re: mkdir vs. GPL

2009-10-29 Thread Jim Meyering
Eric Blake wrote: > The mkdir module is LGPLv2+, but dragged in some GPL stuff. In addition to > the > licensing problems this represents, I'm also getting link failures on the > gnulib-tests directory of coreutils on cygwin 1.5: ... > Jim, Paul - are you okay with weakening the license on portio

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Karl Berry
-#!/usr/bin/perl +#!/bin/sh Just to mention that an alternative would be #!/usr/bin/env perl. I don't know about obscure systems that gnulib may be targeting, but we've used /usr/bin/env for years in TeX Live and elsewhere, so it at least works on a reasonably wide range of systems (GNU,

mkdir vs. GPL

2009-10-29 Thread Eric Blake
The mkdir module is LGPLv2+, but dragged in some GPL stuff. In addition to the licensing problems this represents, I'm also getting link failures on the gnulib-tests directory of coreutils on cygwin 1.5: CCLD test-areadlink.exe ../lib/libcoreutils.a(xalloc-die.o): In function `xalloc_die':

bootstrap diagnostics: grep: amsnippet.tmp: No such file or directory

2009-10-29 Thread Jim Meyering
FYI, before I forget (can't investigate right now)... Running bootstrap for GNU parted, I saw this on fedora rawhide: Copying file ._bootmp/m4/xstrtol.m4 grep: amsnippet.tmp: No such file or directory grep: amsnippet.tmp: No such file or directory grep: amsnippet.tmp: No such file or dire

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Jim Meyering
Ludovic Courtès wrote: > Hello, > > Jim Meyering writes: > >> However, is this really necessary? >> You're not running gitlog-to-changelog manually, are you? >> If it's scripted, you can easily invoke it via "perl gitlog-to-changelog ..." > > True, but then among the scripts under ‘build-aux’, so

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Hello, Jim Meyering writes: > However, is this really necessary? > You're not running gitlog-to-changelog manually, are you? > If it's scripted, you can easily invoke it via "perl gitlog-to-changelog ..." True, but then among the scripts under ‘build-aux’, some are invoked directly by ‘maint.mk

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Jim Meyering
Ludovic Courtès wrote: > Paolo Bonzini writes: > >>> --- a/build-aux/gitlog-to-changelog >>> +++ b/build-aux/gitlog-to-changelog >>> @@ -1,4 +1,7 @@ >>> -#!/usr/bin/perl >>> +#!/bin/sh >>> +# Accommodate systems where /usr/bin/perl is not the right path. >>> +exec perl -x "$0" "$@" >>> +#!perl >>>

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Paolo Bonzini
#! /bin/sh eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; suggested in perlrun(1)? You mean without ‘/usr/bin/’, right? If so, then yes. Yes, of course. Thanks. Paolo

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Hi, Paolo Bonzini writes: >> --- a/build-aux/gitlog-to-changelog >> +++ b/build-aux/gitlog-to-changelog >> @@ -1,4 +1,7 @@ >> -#!/usr/bin/perl >> +#!/bin/sh >> +# Accommodate systems where /usr/bin/perl is not the right path. >> +exec perl -x "$0" "$@" >> +#!perl >> >> The only assumption it mak

Re: maint: avoid usage(1)

2009-10-29 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Meyering on 10/29/2009 6:50 AM: > Eric Blake wrote: >> I noticed this during my audit for stderr vs. exec. We've made previous >> cleanups along these lines, but usages have crept back in. OK to commit? > ... >> Subject: [PATCH] main

Re: Explicit interpreter paths considered harmful

2009-10-29 Thread Paolo Bonzini
--- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -1,4 +1,7 @@ -#!/usr/bin/perl +#!/bin/sh +# Accommodate systems where /usr/bin/perl is not the right path. +exec perl -x "$0" "$@" +#!perl The only assumption it makes is about /bin/sh, but that one seems to be hard (imp

Explicit interpreter paths considered harmful

2009-10-29 Thread Ludovic Courtès
Hello, A number of maintainer scripts explicitly use ‘#!/usr/bin/perl’ or similar, but not all systems have Perl at this location (distros such as NixOS and GoboLinux don’t have it there, and users in general are free to install it elsewhere anyway.) Of course it’d be unreasonable to have ‘AC_PAT

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
Jim Meyering wrote: > I've pushed the following to coreutils. > While I think the rege* changes are useful and do belong in gnulib, > I'll wait to hear that someone else would benefit from doing something > similar before migrating my gl/lib/*.diff patches into gnulib. Humph! ;-) Silly typo. >Fr

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Paolo Bonzini
On 10/29/2009 10:24 AM, Jim Meyering wrote: In making your case, it would be good to be able to itemize the glibc bug fixes that have not yet been ported to gnulib, I think there are none pending. and contrast that gain with the (theoretical?) loss of support for strings of length>= 2GiB. M

[PATCH] timespec: long-to-int truncation could make timespec_cmp malfunction

2009-10-29 Thread Jim Meyering
I noticed a compile-time warning when trying to build faketime: ./lib/timespec.h: In function 'timespec_cmp': ./lib/timespec.h:30: error: conversion to 'int' from 'long int' may alter its value While a tv_nsec value of 10^9 or larger may be unusual, it is certainly possible, and must be acco

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
I've pushed the following to coreutils. While I think the rege* changes are useful and do belong in gnulib, I'll wait to hear that someone else would benefit from doing something similar before migrating my gl/lib/*.diff patches into gnulib. >From e26cb21e6b89b06c8629a44bc6b78b2d46d110c9 Mon Sep

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
Paolo Bonzini wrote: > On 10/29/2009 10:02 AM, Jim Meyering wrote: >> IMHO it is a bug fix. >> A semantically unsigned variable must never be decremented to -1. >> I didn't try to see if it could induce misbehavior. > > No, it couldn't. The problem is that the variable is semantically > unsigned i

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Paolo Bonzini
On 10/29/2009 10:02 AM, Jim Meyering wrote: IMHO it is a bug fix. A semantically unsigned variable must never be decremented to -1. I didn't try to see if it could induce misbehavior. No, it couldn't. The problem is that the variable is semantically unsigned in gnulib because of the IMHO deba

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
Paolo Bonzini wrote: > On 10/29/2009 09:23 AM, Jim Meyering wrote: >>> - Idx idx = re_node_set_contains (dest_nodes, cur_node) - 1; >>> > - re_node_set_remove_at (dest_nodes, idx); >>> > + Idx idx = re_node_set_contains (dest_nodes, cur_node); >>> > + if (id

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Paolo Bonzini
On 10/29/2009 09:23 AM, Jim Meyering wrote: - Idx idx = re_node_set_contains (dest_nodes, cur_node) - 1; > - re_node_set_remove_at (dest_nodes, idx); > + Idx idx = re_node_set_contains (dest_nodes, cur_node); > + if (idx) > + re_node_set_remove_

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
Pádraig Brady wrote: > Jim Meyering wrote: >> Subject: [PATCH 2/2] build (--enable-gcc-warnings): enable gcc's -Werror >> also in lib/ >> >> * configure.ac (GNULIB_WARN_CFLAGS): Define. >> * lib/Makefile.am (AM_CFLAGS): Use $(GNULIB_WARN_CFLAGS) >> rather than $(WARN_CFLAGS) and add $(WERROR_CFLA

Re: enable -Werror for lib/ in coreutils

2009-10-29 Thread Jim Meyering
Paolo Bonzini wrote: >> +diff --git a/lib/regcomp.c b/lib/regcomp.c Hi Paolo. Thanks for the review! > This is okay. > >> diff --git a/gl/lib/regex_internal.c.diff b/gl/lib/regex_internal.c.diff > > This is okay. There is one caller of re_node_set_remove_at, in > regexec.c, which might pass SIZ