Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 1 | The Makefile calls awk on a "*.c" glob. The results of this glob are sorted |
| 2 | but the order depends on the locale settings, particularly whether |
| 3 | "util.c" and "util2.c" sort before or after each other. In en_US.UTF-8 |
| 4 | they sort one way, in C, they sort the other. The sorting order changes |
| 5 | the output binaries. The behaviour also changes dependning on whether |
| 6 | SHELL (/bin/sh) is dash or bash. |
| 7 | |
| 8 | Specify a C locale setting to be deterministic. |
| 9 | |
| 10 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 11 | Submitted: https://github.com/WayneD/rsync/pull/155 |
| 12 | |
| 13 | Upstream-Status: Backport [ish, see below] |
| 14 | |
| 15 | After discussion upstream renamed util.c to util1.c which avoids the problem |
| 16 | in a different way. This patch can be dropped when we upgrade to include: |
| 17 | https://github.com/WayneD/rsync/commit/d3085f7add38a5cf833a0b31cb0637ff46c80f8d |
| 18 | |
| 19 | Index: rsync-3.2.3/Makefile.in |
| 20 | =================================================================== |
| 21 | --- rsync-3.2.3.orig/Makefile.in |
| 22 | +++ rsync-3.2.3/Makefile.in |
| 23 | @@ -26,6 +26,11 @@ MKDIR_P=@MKDIR_P@ |
| 24 | VPATH=$(srcdir) |
| 25 | SHELL=/bin/sh |
| 26 | |
| 27 | +# We use globbing in commands, need to be deterministic |
| 28 | +unexport LC_ALL |
| 29 | +LC_COLLATE=C |
| 30 | +export LC_COLLATE |
| 31 | + |
| 32 | .SUFFIXES: |
| 33 | .SUFFIXES: .c .o |
| 34 | |