[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] bootstrap: use a more consistent error reporting scheme.
From: |
Jim Meyering |
Subject: |
Re: [PATCH] bootstrap: use a more consistent error reporting scheme. |
Date: |
Tue, 10 Jul 2012 07:21:22 +0200 |
Akim Demaille wrote:
> Le 6 juil. 2012 à 14:44, Jim Meyering a écrit :
>> No, but if you think it's better, somehow...
>> I meant that warnf would be a very thin wrapper around printf:
>>
>> $ printf '%s\n' a b c
>> a
>> b
>> c
>>
>>> Or should warnf expect a single %s
>>
>> or multiple %-directives:
>>
>> $ printf '%s - %s\n' a b c d
>> a - b
>> c - d
>
> Ah, I was not aware of this feature, thanks!
> Now I see what you mean (thanks to Stefano too :).
>
> 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_
s/alike/like/
> 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.
> ---
> ChangeLog | 7 +++++++
> build-aux/bootstrap | 41 ++++++++++++++++++++++++++---------------
> 2 files changed, 33 insertions(+), 15 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 785f92f..85d8e4d 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,12 @@
> 2012-07-06 Akim Demaille <address@hidden>
>
> + bootstrap: let warn be alike tests/init.sh's warn_
s/alike/like/
> + 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.
> +
> bootstrap: use a more consistent error reporting scheme
> * build-aux/bootstrap (warn, die): New.
> Use them.
> diff --git a/build-aux/bootstrap b/build-aux/bootstrap
> index 1d61e5c..f895e63 100755
> --- a/build-aux/bootstrap
> +++ b/build-aux/bootstrap
> @@ -1,6 +1,6 @@
> #! /bin/sh
> # Print a version string.
> -scriptversion=2012-07-06.11; # UTC
> +scriptversion=2012-07-06.13; # UTC
>
> # Bootstrap this package from checked-out sources.
>
> @@ -77,15 +77,26 @@ Running without arguments will suffice in most cases.
> EOF
> }
>
> -warn()
> +# warnf_ FORMAT-STRING ARG1...
> +warnf_ ()
> {
> - for i
> - do
> - echo "$i"
> - done | sed -e "s/^/$me: /" >&2
> + warnf_format_=$1
> + shift
> + printf "$warnf_format_" "$@" | sed "s,^,$me: ," >&2
As Eric suggested, please use "|" in place of each ','.
With that and the typo-fix above, ACK.
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., (continued)
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Bruce Korb, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Eric Blake, 2012/07/09
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Eric Blake, 2012/07/09
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme.,
Jim Meyering <=
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Stefano Lattarini, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Stefano Lattarini, 2012/07/06