Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 275956 - sys-libs/glibc-2.9_p20081201-r2: first_weekday=2 with en_GB locale
Summary: sys-libs/glibc-2.9_p20081201-r2: first_weekday=2 with en_GB locale
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://sourceware.org/bugzilla/show_b...
Whiteboard:
Keywords:
: 277954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-30 15:05 UTC by Philip Allison
Modified: 2009-09-07 05:01 UTC (History)
2 users (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 Philip Allison 2009-06-30 15:05:15 UTC
"locale -k -c LC_TIME" returns "first_weekday=2" and "first_workday=2" for the en_GB locale with glibc 2.9_p20081201-r2, with the result that any app that bases its idea of work weeks on these values is convinced that the week starts on Tuesday.  Ones I've noticed being hamster-applet and the GNOME calendar panel applet.

This is obviously wrong; I can assure you that the work week starts on Monday over here. :)

Reproducible: Always

Steps to Reproduce:
1. install glibc 2.9_p20081201-r2
2. locale -k -c LC_TIME
3. look at "first_workday"

Actual Results:  
2

Expected Results:  
1

Possibly the same bug spotted elsewhere: https://bugzilla.redhat.com/show_bug.cgi?id=473445

Portage 2.2_rc33 (default/linux/amd64/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E4500_@_2.20GHz-with-glibc2.2.5
Timestamp of tree: Tue, 30 Jun 2009 14:30:19 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.5.4-r2
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=nocona -march=nocona -O3 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-mtune=nocona -march=nocona -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/crossdev /usr/portage/local/layman/sunrise /usr/portage/local/layman/desktop-effects /usr/portage/local/custom"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi aiglx alsa amd64 applet avahi bash-completion berkdb branding bzip2 cairo cdaudio cddb cdparanoia cdr cli consolekit cracklib crypt cups dbus dvd dvdr dvdread eds emboss emerald encode evo fam fbcon ffmpeg firefox galago gdbm gedit gif glut gmp gnome gnome-keyring gpm gstreamer gtk gtk2 guile hal iconv idn isdnlog java javascript jpeg lcms libnotify libsexy mad midi mikmod mmx mmxext mng mono mozsvg mp3 mpeg mudflap multilib nautilus ncurses networking nis nls nptl nptlonly nsplugin offensive ogg openal opengl openmp pam pcap pcre pdf perl png ppds pppd qt3support quicktime readline reflection samba sasl sdl session smp spell spl sse sse2 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff truetype unicode usb userlocales vim-syntax vorbis widescreen wmf xcb xcomposite xml xml2 xorg xscreensaver xulrunner xv zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-07-16 14:13:34 UTC
Actually, this works fine (Week starts on Monday) in glibc-2.10.1, and the only difference between the old en_GB and the new en_GB is as follows:

# diff -u en_BD en_GB 
--- en_BD	2009-07-16 09:58:42.000000000 -0400
+++ en_GB	2009-05-18 13:17:50.000000000 -0400
@@ -121,7 +121,7 @@
 date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

So first_weekday=2 is correct if week starts on 19971130 and not 19971201!

In either case, this is fixed in glibc-2.10.1

I'll leave it up to the maintainers to decide whether they want to backport the fix to this older glibc.  But as a workaround, you can apply that patch above to your own /usr/share/i18n/locales/en_GB then run 'locale-gen'.
Comment 2 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-07-16 14:15:21 UTC
*** Bug 277954 has been marked as a duplicate of this bug. ***
Comment 3 DEMAINE Benoît-Pierre, aka DoubleHP 2009-07-17 00:53:32 UTC
I reported this recently, but I am having this bug since long time. Maybe 1 or 2 months; maybe 6.

(In reply to comment #1)
> Actually, this works fine (Week starts on Monday) in glibc-2.10.1, and the only
> difference between the old en_GB and the new en_GB is as follows:

Yes, the bug is very old. Way older than "the previous glibc".

I think that week[start]  19971201  makes more sens than 19971130; having the week starting on saturday is a Jewish concept, while having a week starting on sunday is a christian concept; the modern occidental calendar (starting on 15th octobre 1582, after revision by the Pope Gregoire 13) is christian. I am not talking religion, but history. Gregorian calendar is used in almost all countries by now.

man crontab says that day 0 is sunday, and day 1 is monday. I hope glibc will conform to this "standard".
Comment 4 DEMAINE Benoît-Pierre, aka DoubleHP 2009-07-17 01:01:41 UTC
Please have a look at Bug 277954  comments 7, 8 and 10. I think there is more than just a "day start" problem. Cal also have a strange behaviour depending on LANG ... I think there may be more troubles than the diff shown in #1 in here.
Comment 5 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-07-17 14:18:58 UTC
(In reply to comment #3)
> I think that week[start]  19971201  makes more sens than 19971130; having the
> week starting on saturday is a Jewish concept, while having a week starting on
> sunday is a christian concept; the modern occidental calendar (starting on 15th
> octobre 1582, after revision by the Pope Gregoire 13) is christian. I am not
> talking religion, but history. Gregorian calendar is used in almost all
> countries by now.

I think this is irrelevant.  The value in the en_GB locale file is an arbitrary start point, and as long as everything else is correct relative to this arbitrary start point, things will work.

sys-libs/glibc-2.9_p20081201-r2 is broken, since the intent is that the week should start on Monday, but actually comes out as Tuesday.  Thus either the 'week' value is wrong or the 'first_weekday' is wrong.
 
sys-libs/glibc-2.10.1 is not broken, and they have apparently addressed this mistake by changing the 'week' entry and not the 'first_weekday', so I believe that is the appropriate solution that could be back-ported to sys-libs/glibc-2.9_p20081201-r2

You of course are free to alter your own locale any way you like, and you could certainly fix this issue by keeping the 'week' entry the same and adjusting 'first_weekday' instead.  If you think glibc should change their solution in 2.10.1, I suggest reporting this to the glibc authors.
Comment 6 Alan Swanson 2009-08-16 06:24:37 UTC
Could we apply this git commit to fix it please?

http://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=3873630cd814a11a75f2e7173bcf1efd08e94663

Problem originally reported upstream. Issue is that reference date has to be 19971130, not 19971201 due to inherent bug in glibc.
http://sourceware.org/bugzilla/show_bug.cgi?id=7068
Comment 7 SpanKY gentoo-dev 2009-09-07 05:01:33 UTC
only because it's been merged upstream will it be added to Gentoo

ive queued the patch for the next 2.9 patchset