[texinfo] 01/01: make texinfo indices reproducible (Closes: #790065) (thanks to Chris Lamb)
This is an automated email from the git hooks/post-receive script.
preining pushed a commit to branch master
in repository texinfo.
commit d6a04772f6976d2ba4d44006598edfef3ab3f73e
Author: Norbert Preining <preining@debian.org>
Date: Sat Jun 27 23:17:12 2015 +0900
make texinfo indices reproducible (Closes: #790065) (thanks to Chris Lamb)
---
debian/changelog | 6 ++++
debian/patches/series | 1 +
debian/patches/texinfo-make-index-deterministic | 48 +++++++++++++++++++++++++
3 files changed, 55 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index e2a9bf8..d294c77 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+texinfo (6.0.0.dfsg.1-2) unstable; urgency=medium
+
+ * make texinfo indices reproducible (Closes: #790065) (thanks to Chris Lamb)
+
+ -- Norbert Preining <preining@debian.org> Sat, 27 Jun 2015 23:15:25 +0900
+
texinfo (6.0.0.dfsg.1-1) unstable; urgency=medium
* Imported Upstream version 6.0.0.dfsg.1
diff --git a/debian/patches/series b/debian/patches/series
index 7f65b38..2ec6351 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ numerical-signal-names
dont_build_info
info-manpage-mentiones-nonfree
do-not-require-automake-1.15
+texinfo-make-index-deterministic
diff --git a/debian/patches/texinfo-make-index-deterministic b/debian/patches/texinfo-make-index-deterministic
new file mode 100644
index 0000000..de7aa18
--- /dev/null
+++ b/debian/patches/texinfo-make-index-deterministic
@@ -0,0 +1,48 @@
+Make texino indices reproducible by genrating deterministic order
+From Debian #790065
+While working on the "reproducible builds" effort [1], we have noticed
+that texinfo generates indices in a non-deterministic order.
+
+This appears to happen because the index sort is not stable with respect
+to the line number, resulting in output non-determinstically changing
+from:
+
+ * Entry (line 1)
+ * Entry (line 2)
+
+and
+
+ * Entry (line 2)
+ * Entry (line 1)
+
+.. when the entry is the same string.
+
+The attached patch adds the line number to the sort comparator. Once
+applied, (some) packages using texinfo can be built reproducibly in
+our reproducible toolchain.
+
+Patch by Chris Lamb
+---
+ tp/Texinfo/Structuring.pm | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- texinfo.orig/tp/Texinfo/Structuring.pm
++++ texinfo/tp/Texinfo/Structuring.pm
+@@ -1984,6 +1984,9 @@
+ if ($res == 0) {
+ $res = ($key1->{'number'} <=> $key2->{'number'});
+ }
++ if ($res == 0) {
++ $res = ($key1->{'line_nr'} <=> $key2->{'line_nr'});
++ }
+ return $res;
+ }
+
+@@ -2016,6 +2019,7 @@
+ foreach my $index_name (keys(%$index_entries)) {
+ foreach my $entry (@{$index_entries->{$index_name}}) {
+ $entry->{'in_code'} = $index_names->{$entry->{'index_name'}}->{'in_code'};
++ $entry->{'line_nr'} = $entry->{'command'}->{'line_nr'}->{'line_nr'};
+ $options->{'code'} = $entry->{'in_code'};
+ $entry->{'key'} = Texinfo::Convert::Text::convert(
+ {'contents' => $entry->{'content'}}, $options);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-tex/texinfo.git
Reply to: