diff options
author | Jim Meyering <meyering@fb.com> | 2014-06-06 17:17:55 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2014-06-27 13:01:36 -0700 |
commit | 775b724c36e90c90ef520f0294057d4072b1fe66 (patch) | |
tree | afbe024b8ba045c1e273fa726092eaf76c23a246 /Makefile.am | |
parent | 639bfd84e719c451d810015d51386f6a0cc47a0d (diff) | |
download | grep-775b724c36e90c90ef520f0294057d4072b1fe66.tar.gz |
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 26 |
1 files changed, 25 insertions, 1 deletions
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 $@ |