[PATCH v2] gen_build_files: Use C locale when calling sed on globbed files

Denys Vlasenko vda.linux at googlemail.com
Fri May 7 10:26:00 UTC 2021


Let's have a comment what kind of breakage is prevented by this.

Please elaborate what did you observe and which settings of LC_xyz
cause it.

On Thu, May 6, 2021 at 7:40 PM Khem Raj <raj.khem at gmail.com> wrote:
>
> sort order is different based on chosen locale and also default shell
> being bash or dash
>
> This sets the environment variable LC_ALL to the value C, which will
> enforce bytewise sorting, irrespective of the shell
>
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
> v2: Set C locale for whole script
>
>  scripts/gen_build_files.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
> index 92de681ac..8b5b15a1b 100755
> --- a/scripts/gen_build_files.sh
> +++ b/scripts/gen_build_files.sh
> @@ -4,6 +4,8 @@
>  # but users complain that many sed implementations
>  # are misinterpreting --.
>
> +export LC_ALL=C
> +
>  test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
>
>  # cd to objtree
> --
> 2.31.1
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list