Jim Meyering wrote:
> Here's an incomplete patch.
> It needs a test and a NEWS entry.
> Ondřej, can you adjust your test to work (or skip)
> if there is no en* locale?

Maybe something like that (attachment)?
It's checking for existence of locale binary and en_US locale and
performing the test only if both exists. I guess en_US locale is better
than random choosing of one en_* locale. Also NEWS entry added although
it maybe needs some tweaks as usually.

From 3e327dd41c55c5f25180c779a766549b90af59fa Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <ova...@redhat.com>
Date: Fri, 25 Sep 2009 15:20:47 +0200
Subject: [PATCH] tests/misc/ls-time: ls shouldn't show long iso time format for en_* locales

* tests/misc/ls-time: test if ls doesn't show long iso time format
  when en_US locale is present
* NEWS: mention that ls no longer shows long iso time format for en_* locales
 NEWS               |    4 ++++
 tests/misc/ls-time |   13 +++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 1571c9c..2cf8b33 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,10 @@ GNU coreutils NEWS                                    -*- outline -*-
   when the color of a more specific type is disabled.
   [bug introduced in coreutils-5.90]
+  ls -l now correctly shows en_* locale timestamps of files instead of
+  long iso format.
+  [bug introduced in coreutils-6.0]
 ** Portability
   On Solaris 9, many commands would mistakenly treat file/ the same as
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index abdd429..39108f0 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -123,4 +123,17 @@ EOF
+# The output for english locale should differ from long iso format
+# This failed between 6.0 and 7.7
+# Do the test only when locale binary and any en_US locale is available
+if (locale --version) > /dev/null 2>&1; then
+  en_locale=`locale -a | grep "^en_US$"`
+  if test -n $en_locale; then
+    LC_ALL=$en_locale ls -l c >en_output
+    ls -l --time-style=long-iso c >liso_output
+    compare en_output liso_output && { fail=1;
+      echo "Long format timestamp for $en_locale locale is same as for long iso." 1>&2; }
+  fi
 Exit $fail

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy

Reply via email to