bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Test failure due to locale warning in Bash 5.1


From: Marius Bakke
Subject: Test failure due to locale warning in Bash 5.1
Date: Tue, 11 May 2021 23:34:05 +0200

Hi,

test/localenl.sh fails with Bash 5.1 if a locale is missing:

============== _localenl =============
*** localenl.ok Thu Dec 14 17:49:00 2017
--- _localenl   Tue May 11 21:21:16 2021
***************
*** 1,4 ****
--- 1,5 ----
  LC_ALL=C passed
  LC_ALL=POSIX passed
+ ./localenl.sh: line 39: warning: setlocale: LC_ALL: cannot change locale 
(en_US.ISO-8859-1): No such file or directory
  LC_ALL=en_US.ISO-8859-1 passed
  LC_ALL=en_US.UTF-8 passed
make[3]: *** [Makefile:5154: diffout] Error 1
make[3]: Leaving directory '/tmp/guix-build-gawk-5.1.0.drv-0/gawk-5.1.0/test'

Bash 5.0 does not print the warning even though the locale is still
missing.

This horrifying patch works around it:

diff --git a/test/localenl.sh b/test/localenl.sh
index ca3ee64e..d5d721ed 100755
--- a/test/localenl.sh
+++ b/test/localenl.sh
@@ -36,9 +36,9 @@
 AWK=${AWK:-../gawk}
 
 # April 2010: Remove UNKNOWN, causes spurious failures on some systems
-for LC_ALL in C POSIX en_US.ISO-8859-1 en_US.UTF-8 #UNKNOWN 
+for LC in C POSIX en_US.ISO-8859-1 en_US.UTF-8 #UNKNOWN
 do
-export LC_ALL
+export LC_ALL=$LC 2>/dev/null
 cat <<EOF |
 line1
 line2
Not sure what the best approach is.  Thoughts?

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]