]> git.lizzy.rs Git - torbrowser-launcher.git/commitdiff
Make torbrowser-launcher.mo ordering reproducible
authorJonas Witschel <diabonas@archlinux.org>
Sun, 12 Jul 2020 18:00:00 +0000 (20:00 +0200)
committerJonas Witschel <diabonas@archlinux.org>
Mon, 19 Oct 2020 09:46:00 +0000 (11:46 +0200)
The ordering of os.walk() is file system dependent. To make sure that the
generated torbrowser-launcher.mo is reproducible bit for bit no matter on which
file system it was originally generated, sort the files before feeding them to
msgfmt.

setup.py

index 1649eb4690fe581a44bb0641cc1fb4b09cbbd7d3..0a743f7ec26d3007e0eb59b86fa1904b7075892d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,9 @@ def create_mo_files():
         return []
     domain = "torbrowser-launcher"
     mo_files = []
-    po_files = [f for f in next(os.walk(po_dir))[2] if os.path.splitext(f)[1] == ".po"]
+    po_files = sorted(
+        [f for f in next(os.walk(po_dir))[2] if os.path.splitext(f)[1] == ".po"]
+    )
     for po_file in po_files:
         filename, extension = os.path.splitext(po_file)
         mo_file = domain + ".mo"