This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: POSIX timezone (was Re: date command shows time 20 minutes into future)


On Sun, Jan 29, 2012 at 10:46:26AM +0100, Corinna Vinschen wrote:
> On Jan 27 20:38, Corinna Vinschen wrote:
> > On Jan 27 13:16, Christopher Faylor wrote:
> > > On Fri, Jan 27, 2012 at 05:39:52PM +0100, Corinna Vinschen wrote:
> > > >Advantage: Always having a valid POSIX timezone information
> > > >Disadvantage: Takes time every time we start up the first Cygwin process
> > > >in a process tree.  Not a lot on Vista and later, though.
> > > I think it would be better to have a program in the distro which could
> > > set the timezone from Windows given the above.  It could be run when
> > > needed in a startup script, avoiding the need for Cygwin programs to
> > > incur a potentially unneeded performance penalty if TZ is not set.
> I called it "tzset" and added it to our utils.  Starting with XP, it
> uses the geographical location setting of the user to find the right
> mapping, rather than the locale setting.  Only on Windows 2000 which
> doesn't know about the user's geographical location, or if fetching
> the geographical location fails, it falls back to the user's locale.
> Tested on Windows 2000, XP, 7.
> 
> Apart from that, we should add profile.d scripts for sh and csh to set
> TZ using this tool.  Ideally as part of the base-files package.  Which
> reminds me that lang.{sh,csh} should set LANG to the output of locale
> -sU or locale -uU.
> 
> David, any chance you could do that right after we release 1.7.10?

Yes. It's been already modified. I was waiting to have same spare time
to solve a couple of annoyances reported in the list to release an
update, so I'll wait for 1.7.10, no problem.

commit 66fd544b8ca96e053b17d671becf0df47251b7a1
Author: David Sastre Medina <d.sastre.medina@gmail.com>
Date:   Sat Oct 22 00:21:44 2011 +0200

    Added CC0 license header to scripts, and the CC0 license
    itself is under /usr/share/doc/common-licenses/.
    Modified locale setting in /etc/profile.d/lang.{sh,csh} to
    honor the OS setting.
    Corrected some files' header info.
    Added Greg's Wiki http://mywiki.wooledge.org/ in /etc/profile.
    Bumped version number.

Specifically, the /etc/profile.d/lang.{sh,csh} now use this:

i# if no locale variable is set, indicate terminal charset via LANG
test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}" && export LANG=$(locale -sU)

# if no locale variable is set, indicate terminal charset via LANG
if ( $?LC_ALL == 0 && $?LC_CTYPE == 0 && $?LANG == 0 ) setenv LANG = `locale -sU`

-- 
Huella de clave primaria: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]