[tz] [PROPOSED 3/5] Deprecate ‘zic -p POSIXRULES’

Paul Eggert eggert at cs.ucla.edu
Tue Jun 18 19:12:14 UTC 2019


zic’s -p option was intended as a transition from historical
System V code that treated TZ="XXXnYYY" as meaning US
daylight-saving rules in a time zone n hours west of UT,
with XXX abbreviating standard time and YYY abbreviating DST.
zic -p allows the tzdata installer to specify (say)
Europe/Brussels's rules instead of US rules.  This behavior
is not well documented and often fails in practice; for example it
does not work with current glibc for contemporary timestamps, and
it does not work in tzdb itself for timestamps after 2037.
So, document it as being obsolete, with the intent that it
will be removed in a future version.  This change does not
affect behavior of the default installation.
* Makefile, NEWS, tzfile.5, zic.8:
Adjust comments and documentation accordingly.
* Makefile (install): Add support for empty POSIXRULES, which now
means not to use zic -p when installing.
---
 Makefile | 21 +++++++++++++++++----
 NEWS     | 11 +++++++++++
 tzfile.5 | 18 ++++++++++--------
 zic.8    |  7 +++++--
 4 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 35db07d..cda95ea 100644
--- a/Makefile
+++ b/Makefile
@@ -35,11 +35,13 @@ DATAFORM=		main
 
 LOCALTIME=	GMT
 
-# If you want something other than Eastern United States time as a template
-# for handling ruleless POSIX-style timezone environment variables,
+# The POSIXRULES macro controls interpretation of nonstandard and obsolete
+# POSIX-like TZ settings like TZ=’EET-2EEST’ that lack DST transition rules.
+# In the reference implementation, if you want something other than Eastern
+# United States time as a template for handling these settings, you can
 # change the line below (after finding the timezone you want in the
 # one of the $(TDATA) source files, or adding it to a source file).
-# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
+# A setting like TZ='EET-2EEST' is supposed to use the rules in the
 # template file to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
@@ -49,6 +51,15 @@ LOCALTIME=	GMT
 # Use the command
 #	make zonenames
 # to get a list of the values you can use for POSIXRULES.
+#
+# If POSIXRULES is empty, no template is installed; this is the intended
+# future default for POSIXRULES.
+#
+# Nonempty POSIXRULES is obsolete and should not be relied on, because:
+# * It does not work correctly in popular implementations such as GNU/Linux.
+# * It does not work in the tzdb implementation for timestamps after 2037.
+# In short, software should avoid ruleless settings like TZ='EET-2EEST'
+# and so should not depend on the value of POSIXRULES.
 
 POSIXRULES=	America/New_York
 
@@ -570,7 +581,9 @@ install:	all $(DATA) $(REDO) $(MANS)
 			'$(DESTDIR)$(LIBDIR)' \
 			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
 			'$(DESTDIR)$(MANDIR)/man8'
-		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
+		$(ZIC_INSTALL) -l $(LOCALTIME) \
+			`case '$(POSIXRULES)' in ?*) echo '-p';; esac \
+			` $(POSIXRULES) \
 			-t '$(DESTDIR)$(TZDEFAULT)'
 		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
 		cp tzselect '$(DESTDIR)$(BINDIR)/.'
diff --git a/NEWS b/NEWS
index 7aaae11..fffe1b6 100644
--- a/NEWS
+++ b/NEWS
@@ -73,6 +73,17 @@ Unreleased, experimental changes
 
   Changes to documentation and commentary
 
+    The Makefile now documents the POSIXRULES macro as being obsolete,
+    and similarly, zic's -p POSIXRULES option is now documented as
+    being obsolete.  Although the POSIXRULES feature still exists and
+    works as before, in practice it is rarely used for its intended
+    purpose, and it does not work either in the default reference
+    implementation (for timestamps after 2037) or in common
+    implementations such as GNU/Linux (for contemporary timestamps).
+    Since POSIXRULES was designed primarily as a temporary transition
+    facility for System V platforms that died off decades ago, it is
+    being decommissioned rather than institutionalized.
+
     New info on Bonin Islands and Marcus (thanks to Wakaba and Phake Nick.)
 
 
diff --git a/tzfile.5 b/tzfile.5
index 69f8860..cd4c483 100644
--- a/tzfile.5
+++ b/tzfile.5
@@ -156,15 +156,17 @@ must also be set.
 The standard/wall and UT/local indicators were designed for
 transforming a TZif file's transition times into transitions appropriate
 for another time zone specified via a POSIX-style TZ string that lacks rules.
-For example, when TZ="AKST9AKDT" and there is no TZif file "AKST9AKDT",
-the transition times might be adapted from a TZif file with the
+For example, when TZ="EET\*-2EEST" and there is no TZif file "EET\*-2EEST",
+the idea was to adapt the transition times from a TZif file with the
 well-known name "posixrules" that is present only for this purpose and
-is a copy of the file "America/New_York", a file with a different UT offset.
-POSIX does not specify this obsolescent transformational behavior and
-widely used platforms such as GNU/Linux do not support it correctly, so users
-desiring Alaska time should specify TZ="America/Anchorage" for better
-historical coverage, or TZ="AKST9AKDT,M3.2.0,M11.1.0" for POSIX
-conformance and coverage for recent timestamps only.
+is a copy of the file "Europe/Brussels", a file with a different UT offset.
+POSIX does not specify this obsolete transformational behavior,
+the default rules are installation-dependent, and no implementation
+is known to support this feature for timestamps past 2037,
+so users desiring (say) Greek time should instead specify
+TZ="Europe/Athens" for better historical coverage, falling back on
+TZ="EET\*-2EEST,M3.5.0/3,M10.5.0/4" if POSIX conformance is required
+and older timestamps need not be handled accurately.
 .PP
 The
 .BR localtime (3)
diff --git a/zic.8 b/zic.8
index 9c42ae6..4bf69a5 100644
--- a/zic.8
+++ b/zic.8
@@ -94,13 +94,16 @@ no leap second information appears in output files.
 .BI "\*-p " timezone
 Use
 .IR timezone 's
-rules when handling POSIX-format
-TZ strings like "CST6CDT" that lack transition rules.
+rules when handling nonstandard
+TZ strings like "EET\*-2EEST" that lack transition rules.
 .B zic
 will act as if the input contained a link line of the form
 .sp
 .ti +.5i
 Link	\fItimezone\fP		posixrules
+.sp
+This feature is obsolete and poorly supported.
+Among other things it should not be used for timestamps after the year 2037.
 .TP
 .BR "\*-r " "[\fB@\fP\fIlo\fP][\fB/@\fP\fIhi\fP]"
 Reduce the size of output files by limiting their applicability
-- 
2.21.0



More information about the tz mailing list