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

package info (click to toggle)
calibre 6.13.0%2Brepack-2%2Bdeb12u5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,147,768 kB
  • sloc: python: 461,364; ansic: 80,698; cpp: 18,081; javascript: 2,855; xml: 1,297; sh: 892; sql: 683; objc: 544; makefile: 71; perl: 66; sed: 6
file content (26 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (2)
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
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Thu, 15 Dec 2022 00:28:11 +0900
Subject: Sort files and directories for reproducible build

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 22ef575..b4c986a 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):