From 775b724c36e90c90ef520f0294057d4072b1fe66 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 6 Jun 2014 17:17:55 -0700 Subject: maint: generate distributed THANKS from VC'd THANKS.in * Makefile.am (THANKS): New rule. * THANKS.in: New file. * THANKS: Remove. Now it's generated from the combination of THANKS.in and git logs. * .mailmap: New file. * cfg.mk (sc_THANKS_in_duplicates): New syntax-check rule, from coreutils. * .gitignore: Add THANKS. * thanks-gen: New file, from coreutils. --- Makefile.am | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index e618a005..a7250db0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,8 +23,10 @@ EXTRA_DIST = \ ChangeLog-2009 \ README \ README-alpha \ + THANKS.in \ TODO \ - cfg.mk + cfg.mk \ + thanks-gen # Shortcut target to make it easier to run expensive tests. .PHONY: check-expensive @@ -54,3 +56,25 @@ gen-ChangeLog: { rm -f $(distdir)/ChangeLog && \ mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ fi + +# Sort in traditional ASCII order, regardless of the current locale; +# otherwise we may get into trouble with distinct strings that the +# current locale considers to be equal. +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 + $(AM_V_GEN)rm -f $@-t $@; \ + { \ + $(prologue); echo; \ + { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in \ + | grep -v '^$$' | perl -pe 's/ +/\0/'; \ + git log --pretty=format:'%aN%x00%aE' \ + | $(ASSORT) -u; \ + } | $(srcdir)/thanks-gen \ + | LC_ALL=en_US.UTF-8 sort -f; \ + echo; \ + printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \ + } > $@-t && chmod a-w $@-t && mv $@-t $@ -- cgit v1.2.1