|
| 1 | +#!/usr/bin/perl |
| 2 | +=pod |
| 3 | +
|
| 4 | + update-authors.pl is part of Atril. |
| 5 | +
|
| 6 | + Atril 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 | + Atril 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 Atril. 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 'Alexander <sanek23994%gmail.com>' and $_ = 'Alexander Ovchinnikov <sanek23994%gmail.com>' for @authors; |
| 26 | + $_ eq 'bl0ckeduser <bl0ckedusersoft%gmail.com>' and $_ = 'Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>' for @authors; |
| 27 | + $_ eq 'Glorf <michal1.bien%gmail.com>' and $_ = 'Michał Bień <michal1.bien%gmail.com>' for @authors; |
| 28 | + $_ eq 'hekel <hekel%archlinux.info>' and $_ = 'Adam Erdman <hekel%archlinux.info>' for @authors; |
| 29 | + $_ eq 'infirit <infirit%gmail.com>' and $_ = 'Sander Sweers <infirit%gmail.com>' for @authors; |
| 30 | + $_ eq 'Jason Crain <jason%inspiresomeone.us>' and $_ = 'Jason Crain <jason%aquaticape.us>' for @authors; |
| 31 | + $_ eq 'José Aliste <jaliste%src.gnome.org>' and $_ = 'José Aliste <jaliste%gnome.org>' for @authors; |
| 32 | + $_ eq 'leigh123linux <leigh123linux%googlemail.com>' and $_ = 'Leigh Scott <leigh123linux%googlemail.com>' for @authors; |
| 33 | + $_ eq 'lyokha <alexey.radkov%gmail.com>' and $_ = 'Alexey Radkov <alexey.radkov%gmail.com>' for @authors; |
| 34 | + $_ eq 'Martin Wimpress <code%flexion.org>' and $_ = 'Martin Wimpress <martin%mate-desktop.org>' for @authors; |
| 35 | + $_ eq 'monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors; |
| 36 | + $_ eq 'Monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors; |
| 37 | + $_ eq 'oz123 <nahumoz%gmail.com>' and $_ = 'Oz N Tiram <nahumoz%gmail.com>' for @authors; |
| 38 | + $_ eq 'Piiit <pitiz29a%gmail.com>' and $_ = 'Peter Moser <pitiz29a%gmail.com>' for @authors; |
| 39 | + $_ eq 'rootavish <avishkar_gupta%outlook.com>' and $_ = 'Avishkar Gupta <rootavish%gmail.com>' for @authors; |
| 40 | + $_ eq 'rootavish <rootavish%gmail.com>' and $_ = 'Avishkar Gupta <rootavish%gmail.com>' for @authors; |
| 41 | + $_ eq 'raveit <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors; |
| 42 | + $_ eq 'raveit65 <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors; |
| 43 | + $_ eq 'raveit65 <mate%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors; |
| 44 | + $_ eq 'rbuj <robert.buj%gmail.com>' and $_ = 'Robert Buj <robert.buj%gmail.com>' for @authors; |
| 45 | + $_ eq 'Scott Balneaves <sbalneav%ltsp.org>' and $_ = 'Scott Balneaves <sbalneav%mate-desktop.org>' for @authors; |
| 46 | + $_ eq 'Wolfgang Ulbrich <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors; |
| 47 | + return @authors; |
| 48 | +} |
| 49 | + |
| 50 | +sub GetCurrentAuthors { |
| 51 | + my @authors; |
| 52 | + open(FILE,"shell/atril.about") or die "Can't open shell/atril.about"; |
| 53 | + while (<FILE>) { |
| 54 | + if (/^Authors=*(.+)$/) { |
| 55 | + @authors=split(";",$1); |
| 56 | + } |
| 57 | + } |
| 58 | + close FILE; |
| 59 | + return ReplaceAuthors(@authors); |
| 60 | +} |
| 61 | + |
| 62 | +sub GetNewAuthors { |
| 63 | + my @authors = `git log --pretty="%an <%ae>" --since "2012-01-01" -- . "_.h" "_.c" | sort | uniq | sed 's/@/%/g' | sed '/^mate-i18n.*/d'`; |
| 64 | + chomp @authors; |
| 65 | + return ReplaceAuthors(@authors); |
| 66 | +} |
| 67 | + |
| 68 | +my @A = GetCurrentAuthors; |
| 69 | +my @B = GetNewAuthors; |
| 70 | +my @merged = sort { $a cmp $b } keys %{{map {($_ => 1)} (@A, @B)}}; |
| 71 | +print join(';',@merged) . ';'; |
0 commit comments