Skip to content

Commit fddace2

Browse files
rbujraveit65
authored andcommitted
Add update-authors.pl script which helps to update pluma.about
1 parent 60c4197 commit fddace2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

‎update-authors.pl‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/perl
2+
=pod
3+
4+
update-authors.pl is part of Pluma.
5+
6+
Pluma is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation, either version 2 of the License, or
9+
(at your option) any later version.
10+
11+
Pluma is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with Pluma. If not, see <http://www.gnu.org/licenses/>.
18+
19+
=cut
20+
use strict;
21+
use warnings;
22+
23+
sub ReplaceAuthors {
24+
my @authors = @_;
25+
$_ eq 'bl0ckeduser <bl0ckedusersoft%gmail.com>' and $_ = 'Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>' for @authors;
26+
$_ eq 'hekel <hekel%archlinux.info>' and $_ = 'Adam Erdman <hekel%archlinux.info>' for @authors;
27+
$_ eq 'infirit <infirit%gmail.com>' and $_ = 'Sander Sweers <infirit%gmail.com>' for @authors;
28+
$_ eq 'leigh123linux <leigh123linux%googlemail.com>' and $_ = 'Leigh Scott <leigh123linux%googlemail.com>' for @authors;
29+
$_ eq 'lyokha <alexey.radkov%gmail.com>' and $_ = 'Alexey Radkov <alexey.radkov%gmail.com>' for @authors;
30+
$_ eq 'Martin Wimpress <code%flexion.org>' and $_ = 'Martin Wimpress <martin%mate-desktop.org>' for @authors;
31+
$_ eq 'monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors;
32+
$_ eq 'Monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors;
33+
$_ eq 'Patrick Monnerat <pm%rawhide.datasphere.ch>' and $_ = 'Patrick Monnerat <pm%datasphere.ch>' for @authors;
34+
$_ eq 'Paolo Borelli <pborelli%katamail.com>' and $_ = 'Paolo Borelli <pborelli%gnome.org>' for @authors;
35+
$_ eq 'Perberos <perberos%(none).(none)>' and $_ = 'Perberos <perberos%gmail.com>' for @authors;
36+
$_ eq 'raveit <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
37+
$_ eq 'raveit65 <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
38+
$_ eq 'raveit65 <mate%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
39+
$_ eq 'rbuj <robert.buj%gmail.com>' and $_ = 'Robert Buj <robert.buj%gmail.com>' for @authors;
40+
$_ eq 'Scott Balneaves <sbalneav%ltsp.org>' and $_ = 'Scott Balneaves <sbalneav%mate-desktop.org>' for @authors;
41+
$_ eq 'Vadim Barkov <neverscaired%gmail.com>' and $_ = 'Vadim Barkov <vbrkov%gmail.com>' for @authors;
42+
$_ eq 'Wolfgang Ulbrich <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
43+
return @authors;
44+
}
45+
46+
sub GetCurrentAuthors {
47+
my @authors;
48+
open(FILE,"pluma/pluma.about") or die "Can't open pluma/pluma.about";
49+
while (<FILE>) {
50+
if (/^Authors=*(.+)$/) {
51+
@authors=split(";",$1);
52+
}
53+
}
54+
close FILE;
55+
return ReplaceAuthors(@authors);
56+
}
57+
58+
sub GetNewAuthors {
59+
my @authors = `git log --pretty="%an <%ae>" -- . "_.h" "_.c" | sort | uniq | sed 's/@/%/g' | sed '/^mate-i18n.*/d'`;
60+
chomp @authors;
61+
return ReplaceAuthors(@authors);
62+
}
63+
64+
my @A = GetCurrentAuthors;
65+
my @B = GetNewAuthors;
66+
my @merged = sort { $a cmp $b } keys %{{map {($_ => 1)} (@A, @B)}};
67+
print join(';',@merged) . ';';

0 commit comments

Comments
 (0)