]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: sort THANKS using our own gear
authorBernhard Voelker <mail@bernhard-voelker.de>
Thu, 12 Feb 2015 01:35:07 +0000 (02:35 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Thu, 12 Feb 2015 01:35:07 +0000 (02:35 +0100)
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

index cf0c8a02a2f7355d12d35604b912b7a766c534ec..e07bba2f9eca8cd181246335d54b1654ac3cbbd5 100644 (file)
@@ -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 $@