Subject: | PATCH: Deterministically order API elements in pod |
The pod in PPPort.pm contains a section entitled "Provided Perl compatibility API". The elements in that list aren't quite ordered deterministically as it sorts ignoring case, and there are several instances of elements which differ only in case, so which is listed first is random. This patch adds a tie breaker sort taking case into account should two elements be identical caselessly.
The motivation behind this is that sometimes it is useful to compare two different development build structures, like blead at two different times, for example to see what has changed that might be causing a bug. This random ordering in this pod shows up as a false positive difference, distracting from the meaningful changes.
Subject: | 0003-Devel-PPPort-Deterministically-order-API-elements-in.patch |
From 5e04038f42c9bb50fd4102095234e46899234212 Mon Sep 17 00:00:00 2001
From: Karl Williamson <public@khwilliamson.com>
Date: Tue, 16 Jul 2013 12:23:41 -0600
Subject: [PATCH 3/3] Devel::PPPort: Deterministically order API elements in
pod
The pod in PPPort.pm contains a section entitled "Provided Perl
compatibility API". The elements in that list aren't quite ordered
deterministically as it sorts ignoring case, and there are several
instances of elements which differ only in case, so which is listed
first is random. This patch adds a tie breaker sort taking case into
account should two elements be identical caselessly.
The motivation behind this is that sometimes it is useful to compare two
different development build structures, like blead at two different
times, for example to see what has changed that might be causing a bug.
This random ordering shows up as a false positive difference,
distracting from the meaningful changes.
---
cpan/Devel-PPPort/PPPort_pm.PL | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpan/Devel-PPPort/PPPort_pm.PL b/cpan/Devel-PPPort/PPPort_pm.PL
index e1118ca..e873b64 100644
--- a/cpan/Devel-PPPort/PPPort_pm.PL
+++ b/cpan/Devel-PPPort/PPPort_pm.PL
@@ -37,7 +37,7 @@ $data =~ s{^\%(include)\s+(\w+)((?:[^\S\r\n]+.*?)?)\s*$}
$data = expand($data);
-my @api = sort { lc $a cmp lc $b } keys %provides;
+my @api = sort { lc $a cmp lc $b or $a cmp $b } keys %provides;
$data =~ s{^(.*)__PROVIDED_API__(\s*?)^}
{join '', map "$1$_\n", @api}gem;
--
1.8.1.3