proposed time zone package changes (Samoa, Factory, et al.)

Arthur David Olson olsona at lecserver.nci.nih.gov
Wed Oct 13 18:40:58 UTC 2010


Below find proposed time zone package changes; the executive summary:

*	Makefile	Change LOCALTIME default from "Factory" to "GMT";
			do not compile "factory" file
			(but keep it in the distribution).
*	Theory		Remove reference to "Factory" zone.
*	australasia	Change end of DST in Samoa in 2011 from
			2011-04-03 0:00 to 2011-04-03 1:00
			(thanks to Raymond Hughes for a reference).
*	localtime.c	Initialize ttinfo structures filled by tzparse
			(thanks to Ravindra for reporting a valgrind warning).
*	zic.c		Fix generation of POSIX strings for zones with
			rules using "weekday<=n" forms of dates
			(thanks to Lei Liu for finding the problem).
			Also, limit output for non-POSIX-specificable zones
			defined to follow the same rules every year.
			(Note that no zones of either of the above types
			appear in the distribution; these changes cater to
			add-on zones).

If no problems are found, 2010n will appear on 2010-10-25.

				--ado

diff -r -c old/Makefile new/Makefile
*** old/Makefile	Mon Sep 27 09:24:25 2010
--- new/Makefile	Tue Oct 12 12:36:50 2010
***************
*** 1,5 ****
  # <pre>
! # @(#)Makefile	8.8
  # This file is in the public domain, so clarified as of
  # 2009-05-17 by Arthur David Olson.
  
--- 1,5 ----
  # <pre>
! # @(#)Makefile	8.9
  # This file is in the public domain, so clarified as of
  # 2009-05-17 by Arthur David Olson.
  
***************
*** 12,18 ****
  #	make zonenames
  # to get a list of the values you can use for LOCALTIME.
  
! LOCALTIME=	Factory
  
  # If you want something other than Eastern United States time as a template
  # for handling POSIX-style time zone environment variables,
--- 12,18 ----
  #	make zonenames
  # to get a list of the values you can use for LOCALTIME.
  
! LOCALTIME=	GMT
  
  # If you want something other than Eastern United States time as a template
  # for handling POSIX-style time zone environment variables,
***************
*** 262,269 ****
  DOCS=		README Theory $(MANS) date.1 Makefile
  PRIMARY_YDATA=	africa antarctica asia australasia \
  		europe northamerica southamerica
! YDATA=		$(PRIMARY_YDATA) pacificnew etcetera factory backward
! NDATA=		systemv
  SDATA=		solar87 solar88 solar89
  TDATA=		$(YDATA) $(NDATA) $(SDATA)
  TABDATA=	iso3166.tab zone.tab
--- 262,269 ----
  DOCS=		README Theory $(MANS) date.1 Makefile
  PRIMARY_YDATA=	africa antarctica asia australasia \
  		europe northamerica southamerica
! YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
! NDATA=		systemv factory
  SDATA=		solar87 solar88 solar89
  TDATA=		$(YDATA) $(NDATA) $(SDATA)
  TABDATA=	iso3166.tab zone.tab
diff -r -c old/Theory new/Theory
*** old/Theory	Mon Sep 27 09:24:25 2010
--- new/Theory	Tue Oct 12 12:36:50 2010
***************
*** 1,4 ****
! @(#)Theory	8.4
  This file is in the public domain, so clarified as of
  2009-05-17 by Arthur David Olson.
  
--- 1,4 ----
! @(#)Theory	8.5
  This file is in the public domain, so clarified as of
  2009-05-17 by Arthur David Olson.
  
***************
*** 287,294 ****
  See the file `backward' for most of these older names
  (e.g. `US/Eastern' instead of `America/New_York').
  The other old-fashioned names still supported are
! `WET', `CET', `MET', `EET' (see the file `europe'),
! and `Factory' (see the file `factory').
  
  
  ----- Time zone abbreviations -----
--- 287,293 ----
  See the file `backward' for most of these older names
  (e.g. `US/Eastern' instead of `America/New_York').
  The other old-fashioned names still supported are
! `WET', `CET', `MET', and `EET' (see the file `europe').
  
  
  ----- Time zone abbreviations -----
diff -r -c old/australasia new/australasia
*** old/australasia	Mon Sep 27 09:24:27 2010
--- new/australasia	Tue Oct 12 13:14:56 2010
***************
*** 1,5 ****
  # <pre>
! # @(#)australasia	8.18
  # This file is in the public domain, so clarified as of
  # 2009-05-17 by Arthur David Olson.
  
--- 1,5 ----
  # <pre>
! # @(#)australasia	8.19
  # This file is in the public domain, so clarified as of
  # 2009-05-17 by Arthur David Olson.
  
***************
*** 487,497 ****
  # http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
  # </a>
  
  Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
  			-11:26:56 -	LMT	1911
  			-11:30	-	SAMT	1950		# Samoa Time
  			-11:00	-	WST	2010 Sep 26
! 			-11:00	1:00	WSDT	2011 Apr 3
  			-11:00	-	WST
  
  # Solomon Is
--- 487,507 ----
  # http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
  # </a>
  
+ # From Raymond Hughes (2010-10-07):
+ # Please see
+ # <a href="http://www.mcil.gov.ws">
+ # http://www.mcil.gov.ws
+ # </a>,
+ # the Ministry of Commerce, Industry and Labour (sideframe) "Last Sunday
+ # September 2010 (26/09/10) - adjust clocks forward from 12:00 midnight
+ # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
+ # backwards from 1:00am to 12:00am"
+ 
  Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
  			-11:26:56 -	LMT	1911
  			-11:30	-	SAMT	1950		# Samoa Time
  			-11:00	-	WST	2010 Sep 26
! 			-11:00	1:00	WSDT	2011 Apr 3 1:00
  			-11:00	-	WST
  
  # Solomon Is
diff -r -c old/localtime.c new/localtime.c
*** old/localtime.c	Mon Sep 27 09:24:26 2010
--- new/localtime.c	Tue Oct 12 12:36:51 2010
***************
*** 5,11 ****
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)localtime.c	8.14";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 5,11 ----
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)localtime.c	8.15";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 914,919 ****
--- 914,920 ----
  	register unsigned char *	typep;
  	register char *			cp;
  	register int			load_result;
+ 	static struct ttinfo		zttinfo;
  
  	INITIALIZE(dstname);
  	stdname = name;
***************
*** 986,991 ****
--- 987,993 ----
  			/*
  			** Two transitions per year, from EPOCH_YEAR forward.
  			*/
+ 			sp->ttis[0] = sp->ttis[1] = zttinfo;
  			sp->ttis[0].tt_gmtoff = -dstoffset;
  			sp->ttis[0].tt_isdst = 1;
  			sp->ttis[0].tt_abbrind = stdlen + 1;
***************
*** 1099,1106 ****
  			}
  			/*
  			** Finally, fill in ttis.
- 			** ttisstd and ttisgmt need not be handled.
  			*/
  			sp->ttis[0].tt_gmtoff = -stdoffset;
  			sp->ttis[0].tt_isdst = FALSE;
  			sp->ttis[0].tt_abbrind = 0;
--- 1101,1108 ----
  			}
  			/*
  			** Finally, fill in ttis.
  			*/
+ 			sp->ttis[0] = sp->ttis[1] = zttinfo;
  			sp->ttis[0].tt_gmtoff = -stdoffset;
  			sp->ttis[0].tt_isdst = FALSE;
  			sp->ttis[0].tt_abbrind = 0;
***************
*** 1113,1118 ****
--- 1115,1121 ----
  		dstlen = 0;
  		sp->typecnt = 1;		/* only standard time */
  		sp->timecnt = 0;
+ 		sp->ttis[0] = zttinfo;
  		sp->ttis[0].tt_gmtoff = -stdoffset;
  		sp->ttis[0].tt_isdst = 0;
  		sp->ttis[0].tt_abbrind = 0;
diff -r -c old/zic.c new/zic.c
*** old/zic.c	Mon Sep 27 09:24:26 2010
--- new/zic.c	Tue Oct 12 13:37:29 2010
***************
*** 3,9 ****
  ** 2006-07-17 by Arthur David Olson.
  */
  
! static char	elsieid[] = "@(#)zic.c	8.22";
  
  #include "private.h"
  #include "locale.h"
--- 3,9 ----
  ** 2006-07-17 by Arthur David Olson.
  */
  
! static char	elsieid[] = "@(#)zic.c	8.24";
  
  #include "private.h"
  #include "locale.h"
***************
*** 1881,1896 ****
  		register int	week;
  
  		if (rp->r_dycode == DC_DOWGEQ) {
! 			week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
! 			if ((week - 1) * DAYSPERWEEK + 1 != rp->r_dayofmonth)
  				return -1;
  		} else if (rp->r_dycode == DC_DOWLEQ) {
  			if (rp->r_dayofmonth == len_months[1][rp->r_month])
  				week = 5;
  			else {
! 				week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
! 				if (week * DAYSPERWEEK - 1 != rp->r_dayofmonth)
  					return -1;
  			}
  		} else	return -1;	/* "cannot happen" */
  		(void) sprintf(result, "M%d.%d.%d",
--- 1881,1896 ----
  		register int	week;
  
  		if (rp->r_dycode == DC_DOWGEQ) {
! 			if ((rp->r_dayofmonth % DAYSPERWEEK) != 1)
  				return -1;
+ 			week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
  		} else if (rp->r_dycode == DC_DOWLEQ) {
  			if (rp->r_dayofmonth == len_months[1][rp->r_month])
  				week = 5;
  			else {
! 				if ((rp->r_dayofmonth % DAYSPERWEEK) != 0)
  					return -1;
+ 				week = rp->r_dayofmonth / DAYSPERWEEK;
  			}
  		} else	return -1;	/* "cannot happen" */
  		(void) sprintf(result, "M%d.%d.%d",
***************
*** 2018,2023 ****
--- 2018,2024 ----
  	register char *			envvar;
  	register int			max_abbr_len;
  	register int			max_envvar_len;
+ 	register int			prodstic; /* all rules are min to max */
  
  	max_abbr_len = 2 + max_format_len + max_abbrvar_len;
  	max_envvar_len = 2 * max_abbr_len + 5 * 9;
***************
*** 2032,2037 ****
--- 2033,2039 ----
  	timecnt = 0;
  	typecnt = 0;
  	charcnt = 0;
+ 	prodstic = zonecount == 1;
  	/*
  	** Thanks to Earl Chew
  	** for noting the need to unconditionally initialize startttisstd.
***************
*** 2053,2058 ****
--- 2055,2062 ----
  				updateminmax(rp->r_loyear);
  			if (rp->r_hiwasnum)
  				updateminmax(rp->r_hiyear);
+ 			if (rp->r_lowasnum || rp->r_hiwasnum)
+ 				prodstic = FALSE;
  		}
  	}
  	/*
***************
*** 2075,2080 ****
--- 2079,2094 ----
  		if (max_year <= INT_MAX - YEARSPERREPEAT)
  			max_year += YEARSPERREPEAT;
  		else	max_year = INT_MAX;
+ 		/*
+ 		** Regardless of any of the above,
+ 		** for a "proDSTic" zone which specifies that its rules
+ 		** always have and always will be in effect,
+ 		** we only need one cycle to define the zone.
+ 		*/
+ 		if (prodstic) {
+ 			min_year = 1900;
+ 			max_year = min_year + YEARSPERREPEAT;
+ 		}
  	}
  	/*
  	** For the benefit of older systems,



More information about the tz mailing list