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
** Changes in behavior
+ ls -l now uses the traditional three field time style rather than
+ the wider two field numeric ISO style, in locales where a style has
+ not been specified. The new approach has nicer behavior in some
+ locales, including English, which was judged to outweigh the disadvantage
+ of generating less-predictable and often worse output in poorly-configured
+ locales where there is an onus to specify appropriate non-default styles.
+ [The old behavior was introduced in coreutils-6.0 and had been removed
+ for English only using a different method since coreutils-8.1]
+
sort -g now uses long doubles for greater range and precision.
stat no longer accepts the --context (-Z) option. Initially it was
@node Formatting file timestamps
@subsection Formatting file timestamps
-By default, file timestamps are listed in abbreviated form. Most
-locales use a timestamp like @samp{2002-03-30 23:45}. However, the
-default @acronym{POSIX} locale uses a date like @samp{Mar 30@ @ 2002}
-for non-recent timestamps, and a date-without-year and time like
-@samp{Mar 30 23:45} for recent timestamps.
+By default, file timestamps are listed in abbreviated form, using
+a date like @samp{Mar 30@ @ 2002} for non-recent timestamps, and a
+date-without-year and time like @samp{Mar 30 23:45} for recent timestamps.
+This format can change depending on the current locale as detailed below.
A timestamp is considered to be @dfn{recent} if it is less than six
months old, and is not dated in the future. If a timestamp dated
break;
case long_iso_time_style:
- case_long_iso_time_style:
long_time_format[0] = long_time_format[1] = "%Y-%m-%d %H:%M";
break;
case locale_time_style:
if (hard_locale (LC_TIME))
{
- /* Ensure that the locale has translations for both
- formats. If not, fall back on long-iso format. */
int i;
for (i = 0; i < 2; i++)
- {
- char const *locale_format =
- dcgettext (NULL, long_time_format[i], LC_TIME);
- if (locale_format == long_time_format[i])
- goto case_long_iso_time_style;
- long_time_format[i] = locale_format;
- }
+ long_time_format[i] =
+ dcgettext (NULL, long_time_format[i], LC_TIME);
}
}
/* Note we leave %5b etc. alone so user widths/flags are honored. */
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