bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bootstrap: use a more consistent error reporting scheme.


From: Eric Blake
Subject: Re: [PATCH] bootstrap: use a more consistent error reporting scheme.
Date: Mon, 09 Jul 2012 17:04:26 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 07/06/2012 07:11 AM, Akim Demaille wrote:

> How about this?
> 
> From 96b829fb08217060f20a6a56eddb1a952324fa35 Mon Sep 17 00:00:00 2001
> From: Akim Demaille <address@hidden>
> Date: Fri, 6 Jul 2012 15:01:53 +0200
> Subject: [PATCH] bootstrap: let warn be alike tests/init.sh's warn_
> 
> Reported by Jim Meyering.
> * build-aux/bootstrap (warn): Remove, replaced by...
> (warnf_, warn_): these.
> Adjust callers.
> Shorten messages that no longer fit in 80 columns.

> -warn()
> +# warnf_ FORMAT-STRING ARG1...
> +warnf_ ()
>  {
> -  for i
> -  do
> -    echo "$i"
> -  done | sed -e "s/^/$me: /" >&2

This is broken if you invoke './bootstrap', since then $me contains /
and bootstrap complains:

autoreconf: Leaving directory `.'
sed: -e expression #1, char 7: unknown option to `s'

> +  warnf_format_=$1
> +  shift
> +  printf "$warnf_format_" "$@" | sed "s,^,$me: ," >&2

but this isn't much better, since ',' is still easy enough to put in a
file name.  For this reason, the Autoconf manual recommends using s|||,
not s,,, or s///, when dealing with any expression where a file name
will be substituted in place, since it is less likely to encounter file
names that have shell metacharacters in them.

Can we at least push something that unbreaks bootstrap while deciding on
the best final approach to use?

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]