File: 0015-Sort-files-and-directories-for-reproducible-build.patch

package info (click to toggle)
calibre 8.16.2%2Bds%2B~0.10.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 446,080 kB
  • sloc: python: 456,775; cpp: 151,500; ansic: 85,816; javascript: 57,787; xml: 1,247; sh: 957; sql: 735; objc: 330; makefile: 77; sed: 3
file content (28 lines) | stat: -rw-r--r-- 875 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Thu, 15 Dec 2022 00:28:11 +0900
Subject: Sort files and directories for reproducible build

Forwarded: not-needed

note:
  os.walk() returns generator, not list.
  sorted() is not usable here.
---
 setup/gui.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup/gui.py b/setup/gui.py
index b94dfb5..1b6e25c 100644
--- a/setup/gui.py
+++ b/setup/gui.py
@@ -51,7 +51,9 @@ class GUI(Command):
         try:
             os.chdir(self.RESOURCES)
             sources, files = [], []
-            for root, _, files2 in os.walk('images'):
+            for root, dirs, files2 in os.walk('images'):
+                dirs.sort()
+                files2.sort()
                 for name in files2:
                     sources.append(os.path.join(root, name))
             if self.newer(self.RCC, sources):