From: Bernhard Voelker Date: Thu, 12 Feb 2015 01:35:07 +0000 (+0100) Subject: maint: sort THANKS using our own gear X-Git-Tag: v8.24~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07026f62bdf0ef96ee9d2078c50d6baae7d4f6e;p=thirdparty%2Fcoreutils.git maint: sort THANKS using our own gear 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. --- diff --git a/Makefile.am b/Makefile.am index cf0c8a02a2..e07bba2f9e 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 $@