Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49249 - /bin/ls file dates using -l option ignore the locale settings
Summary: /bin/ls file dates using -l option ignore the locale settings
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-27 23:33 UTC by gna
Modified: 2005-01-14 19:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gna 2004-04-27 23:33:39 UTC
The dates output by ls -l use the default C locale format when a locale is explicitly set

Reproducible: Always
Steps to Reproduce:
1. localedef -i en_AU -f UTF-8 en_AU.UTF-8
2. LC_ALL="en_AU.UTF-8" ls -l /
3.

Actual Results:  
drwxr-xr-x    2 root     root         4096 Apr 18 13:21 bin
drwxr-xr-x    2 root     root         4096 Feb 18 21:12 boot
drwxr-xr-x    8 root     root        24576 Apr 18 13:22 dev
drwxr-xr-x   16 root     root         4096 Apr 18 13:37 etc

Expected Results:  
drwxr-xr-x    2 root     root         4096 2004-04-18 13:21 bin
drwxr-xr-x    2 root     root         4096 2004-02-18 21:12 boot
drwxr-xr-x    8 root     root        24576 2004-04-18 13:22 dev
drwxr-xr-x   16 root     root         4096 2004-04-18 13:37 etc

This problem can be fixed by downgrading to coreutils 5.0-r5

This problem also occurs on GRP 2004.0 i686 version and with -march=pentium3 and
-march=pentium4

Portage 2.0.49-r4 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9, 2.4.20-xfs_pre6)
=================================================================
System uname: 2.4.20-xfs_pre6 i686 Celeron (Mendocino)
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i686 -pipe -fomit-frame-pointer"
CHOST="i486-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss apm arts crypt encode foomaticdb gif gpm gtk jpeg kde libg++ libwww
mad mmx mpeg ncurses oggvorbis opengl pdflib png qt sdl slang svga truetype X
xml2 xmms zlib gdbm readline ssl python acpi alsa -avi -berkdb cjk cups doc dvd
esd gnome gpg gtk2 imap -imlib innodb -java maildir -mikmod -motif mozilla mysql
nls pam perl -quicktime radeon -sis -matrox -3dfx -gamma -i8x0 samba -spell sse
tcltk -tcpd tetex tiff usb xv"
Comment 1 Chris White (RETIRED) gentoo-dev 2004-04-28 00:13:15 UTC
Hmm, worked ok for me.  I have an japanese local on my system with coreutils 5.0.91 (The latest ~x86 which I actually was installing to confirm another bug someone had).  Results came out as:

bash-2.05b$ ls -l
合計 48
-rwx------    1 chris    users       44935 11月 15 22:27 GetWineX
bash-2.05b$ 

As shown here, my files are labeled with specific japanese locale.  Might try doing ~x86 and seeing if that works.  I'll simply recommend this as you seem to prefer having the lastest version.
Comment 2 gna 2004-04-28 00:45:36 UTC
I am happy enough with down grading coreutils. I just figured this problem should be reported. I have had this problem occur on quite a few systems so it is not the result of something strange on just one system. For example it occurs on GRP 2004.0 stage3 i.e immediately after you unpack the stage3 tarball. I have also tried various compile flags to get rid of it.
Comment 3 Chris White (RETIRED) gentoo-dev 2004-04-28 07:57:51 UTC
Well, one thing that would better help to assess the situation in case it's version specific would be the version you're referring to.  If I had that, I'd be better able to test that version and see if it's something that truly needs to be fixed.
Comment 4 gna 2004-04-28 21:24:41 UTC
I have tried several versions. All versions more recent than 5.0-r5 seem to have the problem. The main one to test however is sys-apps/coreutils-5.0.91-r4. This version outputs POSIX format dates when the locale is en_AU.UTF-8. To test this you will need to make the locale using localedef. 

The GNU documentation in info:/coreutils/Formatting file timestamps states:
"By default, file timestamps are listed in abbreviated form. Most locales use a timestamp like `2002-03-30 23:45'. However, the default POSIX locale uses a date like `Mar 30 2002' for non-recent timestamps, and a date-without-year and time like `Mar 30 23:45' for recent timestamps."

This format is not a normal Australian date format but that's ok. The POSIX format given by coreutils-5.0.91-r4 is definitely not Australian and thus it must be ignoring the locale which it is not meant to do. 
Comment 5 Chris White (RETIRED) gentoo-dev 2004-04-29 14:41:27 UTC
Testing using the following testcase:

1) emerge the version of coretils given (coreutils-5.0.91-r4)

2) setup Australian locale with localedef

3) setup Australian locale as the current locale

4) ls -la

5) Expected result: dates should be formatted according to Australian locale.
Comment 6 Chris White (RETIRED) gentoo-dev 2004-04-29 14:51:42 UTC
Ok, I'm able to confirm the bug now:

bash-2.05b# localedef -i en_AU -f UTF-8 en_AU.UTF-8
bash-2.05b# LC_ALL="en_AU.UTF-8" 
bash-2.05b# LANG="en_AU.UTF-8"
bash-2.05b# locale
LANG=en_AU.UTF-8
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=en_AU.UTF-8
bash-2.05b# ls -l /home/chris/final_date
final_date   final_date2  
bash-2.05b# ls -l /home/chris/te
temp           test.c         test.vim       test2.txt      
temp_urls.txt  test.r         test2          test_old       
test           test.txt       test2.c        test_old.c     
bash-2.05b# ls -l /home/chris/test.txt
-rw-r--r--    1 chris    root          375 Apr 15 09:38 /home/chris/test.txt

I'll try and see if I can contact someone to help with this bug.
Comment 7 SpanKY gentoo-dev 2005-01-07 19:33:31 UTC
ok, this is broken in coreutils 5.2.1, but it is fixed in upstream cvs ... i wasnt able to track down exactly where the fix occured in cvs, so i'm just going to mark this as UPSTREAM and make you wait for the next coreutils release since this isnt a critical issue

please re-open if you feel so inclined to split off a small cvs patch from upstream to rectify this issue ! :)
Comment 8 gna 2005-01-14 19:33:37 UTC
thanks for persisting with this. It's only a minor issue so I think it is better just to wait for the upstream fix to filter down.