diff options
author | Gary V. Vaughan <gary@gnu.org> | 2014-11-20 22:37:10 +0000 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2014-11-20 22:37:10 +0000 |
commit | 1b2390f2be02bcf31d9112034de33584596f598e (patch) | |
tree | fae3a768269db951d22f7a2bf45bae77b3ae5b1d | |
parent | 4e9147c19130312b6ae4e93d7982393b78dbfc3b (diff) | |
download | m4-1b2390f2be02bcf31d9112034de33584596f598e.tar.gz |
maint: add forgotten thanks-gen script.
* .gitignore: Don't ignore build-aux/thanks-gen.
* build-aux/thanks-gen: New script.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build-aux/thanks-gen | 20 |
2 files changed, 21 insertions, 0 deletions
@@ -30,6 +30,7 @@ build-aux/ !build-aux/gl/ !build-aux/gnulib/ !build-aux/m4/ +!build-aux/thanks-gen /ChangeLog /config.cache /config.h diff --git a/build-aux/thanks-gen b/build-aux/thanks-gen new file mode 100755 index 00000000..92090ced --- /dev/null +++ b/build-aux/thanks-gen @@ -0,0 +1,20 @@ +#!/usr/bin/perl -nl +# Use Perl's multi-byte alignment code, via sprintf, while +# performing a rudimentary check for duplicate names and +# removing duplicate name,email pairs. +use Encode; + +BEGIN { my (%elide, %seen, %name) } + +chomp; +my ($name, $email) = split '\0', decode ('UTF-8', $_); + +if ($elide{"!$name"}) { +; # ignore this author +} elsif (index ($name, '!') == 0) { + $elide{$name}++; +} elsif ($seen{$name}++) { + warn "$0: NO-THANKS: duplicate name: $name\n"; +} else { + print encode ('UTF-8', sprintf ('%-36s', $name)), $email; +} |