Hi Norbert

On Monday, 10 October 2022 17:44:56 AEDT Norbert Preining wrote:
> @@ -76,11 +76,14 @@ dhit_build_format ()
>      tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
>      # save LANG
>      LANGSAVE=$LANG
> +    LCALLSAVE=$LCALLSAVE
>      LANG=C
> +    LC_ALL=C
>      printf "Building format(s) $*.\n\tThis may take some time... "
>      if $FMTUTIL "$@" > $tempfile 2>&1 ; then
>          rm -f $tempfile
>          LANG=$LANGSAVE
> +        LC_ALL=$LCALLSAVE
>          echo "done."
>      else
>          exec >&2

almost -- LC_ALL needs to be exported too, otherwise it won't get passed to 
the child process unless it already happens to be exported, and it isn't 
exported in my environment. LANG should probably also be exported.

Alternatively, the temporary environment setting could go into the "if" 
statement with no need for the saving, exporting, and undoing steps. The 
environment modification is only needed for the fmutil call, not the other 
steps:

   tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
   printf "Building format(s) $*.\n\tThis may take some time... " 
   if LANG=C LC_ALL=C $FMTUTIL "$@" > $tempfile 2>&1 ; then 
       rm -f $tempfile 
       echo "done." 
   else
[... etc ...]


regards
Stuart

-- 
Stuart Prescott    http://www.nanonanonano.net/   stu...@nanonanonano.net
Debian Developer   http://www.debian.org/         stu...@debian.org
GPG fingerprint    90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7

Reply via email to