summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-09-28 17:32:15 +0100
committerPádraig Brady <P@draigBrady.com>2010-07-01 13:12:52 +0100
commit8aa15b2be2bd2ab4b76d197a279abf8b9091680a (patch)
tree6a4d05b3b9d2c55875389f24dac5a4c032bca417 /tests
parent7336920dd07478b7bdae05ec599da4e2e66a94ff (diff)
downloadcoreutils-8aa15b2be2bd2ab4b76d197a279abf8b9091680a.tar.xz
ls: use the POSIX date style when the locale does not specify one
Previously we defaulted to "long-iso" format in locales without specific format translations, like the en_* locales for example. This reverts part of commit 6837183d, 08-11-2005, "ls ... acts like --time-style='posix-long-iso' if the locale settings are messed up" * src/ls.c (decode_switches): Only use the ISO format when specified. * NEWS: Mention the change in behavior. Reported by Daniel Qarras at http://bugzilla.redhat.com/525134
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/ls-time20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index 1d10abb38..beea159c2 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -122,4 +122,24 @@ EOF
fail=1
fi
+# This check is ineffective if:
+# en_US locale is not on the system.
+# The system en_US message catalog has a specific TIME_FMT translation,
+# which was inadvertently the case between coreutils 8.1 and 8.5 inclusive.
+
+if gettext --version >/dev/null 2>&1; then
+
+ default_tf1='%b %e %Y'
+ en_tf1=$(LC_ALL=en_US gettext coreutils "$default_tf1")
+
+ if test "$default_tf1" = "$en_tf1"; then
+ LC_ALL=en_US ls -l c >en_output
+ ls -l --time-style=long-iso c >liso_output
+ if compare en_output liso_output; then
+ fail=1
+ echo "Long ISO TIME_FMT being used for en_US locale." >&2
+ fi
+ fi
+fi
+
Exit $fail