Package: ikiwiki
Version: 3.20150329
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
Control: block 785736 with -1

I noticed in https://bugs.debian.org/785736 that the ikiwiki
documentation for git-annex contains some non-deterministic URLs in the
links generated for comments.  Those links come from IkiWiki::cgiurl,
which generates the URLs in non-deterministic fashion.

The attached patch should fix this form of non-determinism (though
timestamps and other non-determinism still remain in ikiwiki, i think).

Regards,

        --dkg

From 0f8f7ca6acd4999bc6f9e79183518acac480fd31 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <d...@fifthhorseman.net>
Date: Tue, 19 May 2015 14:09:38 -0400
Subject: [PATCH] make cgiurl output deterministic

IkiWiki::cgiurl() currently produces non-deterministic output, because
the params hash can be sorted different ways.

Sorting keys to params before crafting the string should make the
output deterministic.
---
 IkiWiki.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IkiWiki.pm b/IkiWiki.pm
index bb36b08..a707735 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1217,7 +1217,7 @@ sub cgiurl (@) {
 	}
 
 	return $cgiurl."?".
-		join("&amp;", map $_."=".uri_escape_utf8($params{$_}), keys %params);
+		join("&amp;", map $_."=".uri_escape_utf8($params{$_}), sort(keys %params));
 }
 
 sub cgiurl_abs (@) {
-- 
2.1.4

Attachment: signature.asc
Description: PGP signature

Reply via email to