From f998d79461ff8292f65e647ed65a0a6d194c4e5e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 May 2021 14:38:44 +0200 Subject: [PATCH] Bug 28386: Sort authors by lastname || firstname If several authors have the same lastname, they are swapped in the list between the different runs. This is reusing the code from the release_tools, see issue #24 Signed-off-by: Jonathan Druart (cherry picked from commit 3e8b14aa8e07703c5e3d8a42b6431352e3883f68) Signed-off-by: Fridolin Somers (cherry picked from commit adb61b53d361859b1b910d697ac4970c4c0c66b9) Signed-off-by: Victor Grousset/tuxayo (cherry picked from commit 00710babcae5408e522bab1dff5e70c364fc627b) Signed-off-by: Wainui Witika-Park (cherry picked from commit 00710babcae5408e522bab1dff5e70c364fc627b) --- about.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/about.pl b/about.pl index 029558bcec..dfb6264817 100755 --- a/about.pl +++ b/about.pl @@ -687,10 +687,15 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) { my @people = map { { name => $_, ( $contributors->{$_} ? %{ $contributors->{$_} } : () ) } } sort { - my ($alast) = ( split( /\s/, $a ) )[-1]; - my ($blast) = ( split( /\s/, $b ) )[-1]; - lc($alast) cmp lc($blast) -} keys %{$contributors}; + my ($alast) = $a =~ /(\S+)$/; + my ($blast) = $b =~ /(\S+)$/; + my $cmp = lc($alast||"") cmp lc($blast||""); + return $cmp if $cmp; + + my ($a2last) = $a =~ /(\S+)\s\S+$/; + my ($b2last) = $b =~ /(\S+)\s\S+$/; + lc($a2last||"") cmp lc($b2last||""); +} keys %$contributors; $template->param( contributors => \@people ); $template->param( maintenance_team => $teams->{team}->{$dev_team} ); -- 2.39.5