From fe8a153648f98c6dfbb621f31c212253c06f9467 Mon Sep 17 00:00:00 2001
From: Mathieu Bridon <bochecha@daitauha.fr>
Date: Wed, 27 Jun 2018 12:37:38 +0200
Subject: python: Stabilize some script outputs

In Python, dictionaries and sets are unordered, and as a result their
is no guarantee that running this script twice will produce the same
output.

Using ordered dicts and explicitly sorting items makes the build more
reproducible, and will make it possible to verify that we're not
breaking anything when we move the build scripts to Python 3.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
---
 src/amd/common/sid_tables.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/amd/common/sid_tables.py')

diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py
index 4e53acefa44..ca90f82535d 100644
--- a/src/amd/common/sid_tables.py
+++ b/src/amd/common/sid_tables.py
@@ -65,7 +65,7 @@ class StringTable:
         fragments = [
             '"%s\\0" /* %s */' % (
                 te[0].encode('string_escape'),
-                ', '.join(str(idx) for idx in te[2])
+                ', '.join(str(idx) for idx in sorted(te[2]))
             )
             for te in self.table
         ]
-- 
cgit v1.2.3