[linux] 04/04: Make the pickled config (config.defines.dump) reproducible

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sat Jan 7 18:52:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 9747655f89997099ffc5a73f065d22201b1e24c1
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sat Jan 7 18:25:56 2017 +0000

    Make the pickled config (config.defines.dump) reproducible
---
 debian/changelog                         | 1 +
 debian/lib/python/debian_linux/config.py | 4 +++-
 debian/rules                             | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f37c74c..6bd2889 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ linux (4.9.1-1~exp2) UNRELEASED; urgency=medium
   * abiupdate.py: Use current config instead of downloading previous config
   * abiupdate.py: Update base URLs
   * abiupdate.py: Add support for incoming.ports.debian.org
+  * Make the pickled config (config.defines.dump) reproducible
 
  -- Ben Hutchings <ben at decadent.org.uk>  Sat, 07 Jan 2017 17:41:34 +0000
 
diff --git a/debian/lib/python/debian_linux/config.py b/debian/lib/python/debian_linux/config.py
index 5e6ace1..004469a 100644
--- a/debian/lib/python/debian_linux/config.py
+++ b/debian/lib/python/debian_linux/config.py
@@ -1,3 +1,4 @@
+import collections
 import os
 import os.path
 import pickle
@@ -43,7 +44,8 @@ class SchemaItemList(object):
         return [j.strip() for j in re.split(self.type, i)]
 
 
-class ConfigCore(dict):
+# Using OrderedDict instead of dict makes the pickled config reproducible
+class ConfigCore(collections.OrderedDict):
     def get_merge(self, section, arch, featureset, flavour, key, default=None):
         temp = []
 
diff --git a/debian/rules b/debian/rules
index 486ea69..8ee38b6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -105,7 +105,8 @@ else
 endif
 
 debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
-	$<
+# Hash randomisation makes the pickled config unreproducible
+	PYTHONHASHSEED=0 $<
 	md5sum $^ > debian/control.md5sum
 	@echo
 	@echo This target is made to fail intentionally, to make sure

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list