From 63d0a017431d773bc9a62044de85c44cd56e77da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 23 Jan 2013 10:24:30 +0100 Subject: [PATCH] fix the release ordering on the testsuite page now Ic-1 Ic-11 I-10 I-2 will be sorted as Ic-11 I-10 I-2 Ic-1 --- Maintenance/test_handling/create_testresult_page | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index a1c6a2f9f0c..d2c4e6c4003 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -47,19 +47,16 @@ sub sort_releases($$) my $b = $_[0]; my $a = $_[1]; - my @A = ($a =~ /\d+|Ic?/g); - my @B = ($b =~ /\d+|Ic?/g); + #take only the numbers from release id, skipping I and Ic + my @A = ($a =~ /\d+/g); + my @B = ($b =~ /\d+/g); while(@A and @B) { my $av = shift(@A); my $bv = shift(@B); - - if( $av =~ /^\d+$/ and $bv =~ /^\d+$/ ) { - if($av == $bv) { next; } - else { return $av <=> $bv; } - } else { - return $av cmp $bv - } + #$av and $bv are integers + if($av == $bv) { next; } + return $av <=> $bv; } return @A <=> @B; }