Source: bsdmainutils
Version: 9.0.10
Severity: wishlist
Tags: patch upstream
User: reproducible-bui...@lists.alioth.debian.org
Usertags: locale toolchain
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that 'lorder' from bsdmainutils orders symbols differently depending on
the used locale.

The attached patch uses the C locale for sorting/joining the symbols to
allow reproducible builds of packages using lorder.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/deterministic-order.patch b/debian/patches/deterministic-order.patch
new file mode 100644
index 0000000..7a0f4a6
--- /dev/null
+++ b/debian/patches/deterministic-order.patch
@@ -0,0 +1,17 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Use C locale for sorting/joining symbols
+ Or else the order is different under different locales
+
+--- a/usr.bin/lorder/lorder.sh
++++ b/usr.bin/lorder/lorder.sh
+@@ -75,7 +75,7 @@
+ 
+ # sort symbols and references on the first field (the symbol)
+ # join on that field, and print out the file names (dependencies).
+-sort -k 2 -o $R $R
+-sort -k 2 -o $S $S
+-join -j 2 -o 1.1,2.1 $R $S
++LC_ALL=C sort -k 2 -o $R $R
++LC_ALL=C sort -k 2 -o $S $S
++LC_ALL=C join -j 2 -o 1.1,2.1 $R $S
+ rm -f $R $S
diff --git a/debian/patches/series b/debian/patches/series
index 87c6dae..6a7101d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+deterministic-order.patch
 calendar.diff
 calendar_wcs.diff
 calendar_weekend.diff

Reply via email to