Source: nexuiz-data
Version: 2.5.2-6
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: locale
X-Debbugs-Cc: [email protected]
Hi!
While working on the "reproducible builds" effort [1], we have noticed
that nexuiz-data could not be built reproducibly.
During build a checksum over configuration settings is calculated and
embedded in some files. The lines are sorted before generating the
checksum, but sort behaves differently depending on the configured
locale.
The attached patch sorts with the locale set to C, so that the same
values are generated independent of the current locale.
Regards,
Reiner
[1]: https://wiki.debian.org/ReproducibleBuilds
diff -uprN 1/debian/patches/reproducible_build.diff 2/debian/patches/reproducible_build.diff
--- 1/debian/patches/reproducible_build.diff 1970-01-01 01:00:00.000000000 +0100
+++ 2/debian/patches/reproducible_build.diff 2015-12-21 15:37:37.000000000 +0100
@@ -0,0 +1,16 @@
+--- a/data/update-cvarcount.sh
++++ b/data/update-cvarcount.sh
+@@ -2,10 +2,10 @@
+
+ balance_cfgs="balanceHavoc.cfg balance25.cfg balanceSamual.cfg"
+
+-countd=`awk '/^seta? g_/ { print $2; }' defaultNexuiz.cfg | sort -u | tr -d '\r' | md5sum | cut -c 1-32`
+-countw=`awk '/^seta? g_/ { print $2; }' balance.cfg | sort -u | tr -d '\r' | md5sum | cut -c 1-32`
++countd=`awk '/^seta? g_/ { print $2; }' defaultNexuiz.cfg | LC_ALL=C sort -u | tr -d '\r' | md5sum | cut -c 1-32`
++countw=`awk '/^seta? g_/ { print $2; }' balance.cfg | LC_ALL=C sort -u | tr -d '\r' | md5sum | cut -c 1-32`
+ for b in $balance_cfgs; do
+- countb=`awk '/^seta? g_/ { print $2; }' "$b" | sort -u | tr -d '\r' | md5sum | cut -c 1-32`
++ countb=`awk '/^seta? g_/ { print $2; }' "$b" | LC_ALL=C sort -u | tr -d '\r' | md5sum | cut -c 1-32`
+ if [ "$countw" != "$countb" ]; then
+ echo "Mismatch between balance.cfg and $b. Aborting."
+ exit 1
diff -uprN 1/debian/patches/series 2/debian/patches/series
--- 1/debian/patches/series 2011-06-29 15:33:05.000000000 +0200
+++ 2/debian/patches/series 2015-12-21 15:37:03.000000000 +0100
@@ -5,3 +5,4 @@
05_disable_development_warning.diff
exclude_textures_from_data.pk3.diff
windowed_by_default.diff
+reproducible_build.diff