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)


Hi David,

On Jan 29 13:51, David Sastre Medina wrote:
> On Sun, Jan 29, 2012 at 10:46:26AM +0100, Corinna Vinschen wrote:
> > 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`

Oops, the csh version will result in an error message "setenv: Too many
arguments." The reason is the equal sign in the setenv call, which is
wrong.  That should be

  setenv LANG `locale -sU`

For tzset.sh and tzset.csh I would suggest something similar:

  test -z "$TZ" && export TZ=$(tzset)

  if ( $?TZ == 0 ) setenv TZ `tzset`


Thanks,
Corinna


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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