[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: sort THANKS using our own gear
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] maint: sort THANKS using our own gear |
Date: |
Thu, 12 Feb 2015 03:46:20 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 12/02/15 01:45, Bernhard Voelker wrote:
> On 02/11/2015 04:05 PM, Pádraig Brady wrote:
>> +1.
>
> Here's v2 with the FIXME comment to remove the dependency to
> build sort.
>
> For the preparation of the list coming from THANKS.in, I squashed
> the 2x perl + 1x grep calls into one perl expression.
>
> Have a nice day,
> Berny
>
>>From a07026f62bdf0ef96ee9d2078c50d6baae7d4f6e Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <address@hidden>
> Date: Thu, 12 Feb 2015 02:35:07 +0100
> Subject: [PATCH-v2] maint: sort THANKS using our own gear
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> At least 'sort' on openSUSE/Fedora have a bug in the case-folding code
> of their I18N downstream patch which leads to wrong sort results,
> e.g. "Dániel" coming after "Dylan".
>
> * Makefile.am (THANKS): Sort the final contributor list using our
> own sort implementation - as others may result in a different order;
> add a FIXME comment to remove this again once common platforms have
> a functional 'sort -f'. Add '-k1,1' for a better sort order.
> While at it, save a grep and perl call to prepare the list from
> 'THANKS.in' by doing all in the first perl call.
> ---
> Makefile.am | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index cf0c8a0..e07bba2 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -158,16 +158,21 @@ ASSORT = LC_ALL=C sort
> # Extract all lines up to the first one starting with "##".
> prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
>
> -THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
> +# FIXME: avoid dependency to build our own 'sort' for 'make dist' ...
> +# when common platforms have a functional case-folding implementation:
> +# $ test 'abácad' = "$(printf '%s\n' 'ab' 'ác' 'ad' \
> +# | LC_ALL=en_US.UTF-8 sort -f \
> +# | tr -d '\n')" && echo GOOD || echo BAD
> +THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version $(srcdir)/src/sort
> $(AM_V_GEN)rm -f $@-t $@; \
> { \
> $(prologue); echo; \
> - { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in \
> - | grep -v '^$$' | perl -pe 's/ +/\0/'; \
> + { perl -ne '/^$$/.../^$$/ and !/^$$/ and s/ +/\0/ and print' \
> + $(srcdir)/THANKS.in; \
> git log --pretty=format:'%aN%x00%aE' \
> | $(ASSORT) -u; \
> } | $(srcdir)/thanks-gen \
> - | LC_ALL=en_US.UTF-8 sort -f; \
> + | LC_ALL=en_US.UTF-8 $(srcdir)/src/sort -f -k1,1; \
> echo; \
> printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
> } > $@-t && chmod a-w $@-t && mv $@-t $@
>
Very nice.
thanks,
Pádraig.