Skip to content

Commit b7eb181

Browse files
reinerhPovilas Kanapickas
authored andcommitted
Make build process deterministic by sorting files
1 parent 4271d94 commit b7eb181

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ output/qch-help-project-cpp.xml: output/cppreference-doc-en-cpp.devhelp2
175175

176176
pushd "output/reference" > /dev/null; \
177177
find . -type f -not -iname "*.ttf" \
178-
-exec echo "<file>"'{}'"</file>" >> "../qch-files.xml" \; ; \
178+
-exec echo "<file>"'{}'"</file>" \; | LC_ALL=C sort >> "../qch-files.xml" ; \
179179
popd > /dev/null
180180

181181
echo "</files>" >> "output/qch-files.xml"

build_link_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def build_link_map(directory):
3737

3838
link_map = LinkMap()
3939

40-
for fn in html_files:
40+
for fn in sorted(html_files):
4141
f = open(fn, "r")
4242
text = f.read()
4343
f.close()

index2doxygen-tag.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from index_transform import IndexTransform
2222
from xml_utils import xml_escape
2323
from link_map import LinkMap
24+
from functools import total_ordering
2425
import sys
2526

2627
if len(sys.argv) != 4:
@@ -51,6 +52,7 @@ class ItemKind:
5152
TYPEDEF = 3,
5253
NAMESPACE = 4
5354

55+
@total_ordering
5456
class Item:
5557

5658
def __init__(self):
@@ -60,6 +62,12 @@ def __init__(self):
6062
self.link = ""
6163
self.members = {}
6264

65+
def __eq__(self, other):
66+
return self.full_name == other.full_name
67+
68+
def __lt__(self, other):
69+
return self.full_name < other.full_name
70+
6371
ns_map = Item()
6472

6573
def add_to_map(full_name, full_link, item_kind):
@@ -108,7 +116,7 @@ def add_to_map(full_name, full_link, item_kind):
108116

109117
def print_members(out_f, curr_item):
110118
global link_map
111-
for item in curr_item.members.values():
119+
for item in sorted(curr_item.members.values()):
112120
if link_map:
113121
link = link_map.get_dest(item.link)
114122
if link == None and item.kind != ItemKind.NAMESPACE:
@@ -151,12 +159,12 @@ def print_map_item(out_f, curr_item):
151159
print_members(out_f, curr_item)
152160
out_f.write(' </compound>\n')
153161

154-
for item in curr_item.members.values():
162+
for item in sorted(curr_item.members.values()):
155163
if item.kind in [ ItemKind.NAMESPACE, ItemKind.CLASS ]:
156164
print_map_item(out_f, item)
157165

158166
def print_map(out_f, ns_map):
159-
for item in ns_map.members.values():
167+
for item in sorted(ns_map.members.values()):
160168
if item.kind in [ ItemKind.NAMESPACE, ItemKind.CLASS ]:
161169
print_map_item(out_f, item)
162170
else:

0 commit comments

Comments
 (0)