From cd6b39257050df2ed1def9d868547fe9742c16d5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 25 Aug 2021 19:11:29 +0200 Subject: meson: run generate_version.sh in a C locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, only the date command inside the script was run with LC_TIME=C. But there’s no reason to be that conservative; we absolutely do not want _anything_ in that script to generate locale dependent output. --- generate-version.sh | 2 +- meson.build | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generate-version.sh b/generate-version.sh index c77560a..e178b7e 100755 --- a/generate-version.sh +++ b/generate-version.sh @@ -17,7 +17,7 @@ if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then git_branch=$(git rev-parse --abbrev-ref HEAD) cd "${workdir}" - new_version="${git_version} ($(env LC_TIME=C date "+%b %d %Y"), branch '${git_branch}')" + new_version="${git_version} ($(date "+%b %d %Y"), branch '${git_branch}')" else new_version="${default_version}" fi diff --git a/meson.build b/meson.build index 08217b7..e46e645 100644 --- a/meson.build +++ b/meson.build @@ -91,12 +91,13 @@ foreach prot : [ command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@']) endforeach +env = find_program('env', native: true) generate_version_sh = files('generate-version.sh') version = custom_target( 'generate_version', build_always_stale: true, output: 'version.h', - command: [generate_version_sh, meson.project_version(), '@SOURCE_ROOT@', '@OUTPUT@']) + command: [env, 'LC_ALL=C', generate_version_sh, meson.project_version(), '@SOURCE_ROOT@', '@OUTPUT@']) image_format_sources = [] if png.found() -- cgit v1.2.3