[tz] [PATCH v2 1/1] Allow data from 'backzone' to be incorporated in 'right' data
Ian Abbott
abbotti at mev.co.uk
Thu Sep 24 18:45:41 UTC 2015
* NEWS: Document this.
* Makefile: Add targets 'posix_right_packrat', 'right_packrat', and
'right_posix_packrat' which behave like 'posix_right', 'right_only', and
'right_posix', but incorporate information from the 'backzone' file into
the data sets in the same way as the existing 'posix_packrat' target.
---
v2: Correct the compound shell commands; they need some braces.
Makefile | 77 ++++++++++++++++++++++++++++++++++++++++++++++++----------------
NEWS | 8 +++++++
2 files changed, 66 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile
index d2f64c8..9b7ca67 100644
--- a/Makefile
+++ b/Makefile
@@ -72,23 +72,29 @@ MANDIR= $(TOPDIR)/man
LIBDIR= $(TOPDIR)/lib
-# If you always want time values interpreted as "seconds since the epoch
-# (not counting leap seconds)", use
-# REDO= posix_only
-# below. If you always want right time values interpreted as "seconds since
-# the epoch" (counting leap seconds)", use
-# REDO= right_only
-# below. If you want both sets of data available, with leap seconds not
-# counted normally, use
-# REDO= posix_right
-# below. If you want both sets of data available, with leap seconds counted
-# normally, use
-# REDO= right_posix
-# below. If you want just POSIX-compatible time values, but with
-# out-of-scope and often-wrong data from the file 'backzone', use
-# REDO= posix_packrat
+# Set 'REDO' according to the table below.
+#
+# REDO= posix? right? default + packrat?
+# ------------------- ------ ------ ------- ----------
+# posix_only Yes No posix No
+# right_only No Yes right No
+# posix_right Yes Yes posix No
+# right_posix Yes Yes right No
+# posix_packrat Yes No posix Yes
+# right_packrat No Yes right Yes
+# posix_right_packrat Yes Yes posix Yes
+# right_posix_packrat Yes Yes right Yes
+#
+# A "Yes" in the "posix?" column indicates that POSIX-compatible time values
+# interpreted as "seconds since the epoch (not counting leap seconds)" are
+# available. A "Yes" in the "right?" column indicates that right time values
+# interpreted as "seconds since the epoch (counting leap seconds)" are
+# available. The "default" column indicates the set of values used by default.
+# A "Yes" in the "+ packrat?" column indicates that out-of-scope and
+# often wrong data from the file 'backzone' is to be included.
+#
# POSIX mandates that leap seconds not be counted; for compatibility with it,
-# use "posix_only", "posix_right", or "posix_packrat".
+# use "posix_only", "posix_right", "posix_packrat", or "posix_right_packrat".
REDO= posix_right
@@ -441,11 +447,44 @@ posix_right: posix_only leapseconds
$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
-L leapseconds $(TDATA)
+right_packrat: right_only leapseconds backzone
+ $(AWK) '/^Rule/' $(TDATA) | \
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
+ -L leapseconds - backzone
+
posix_packrat: posix_only backzone
$(AWK) '/^Rule/' $(TDATA) | \
$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
-L /dev/null - backzone
+right_posix_packrat: right_packrat leapseconds backzone
+ rm -fr $(DESTDIR)$(TZDIR)-leaps
+ ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
+ { $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
+ -L leapseconds $(TDATA) && \
+ $(AWK) '/^Rule/' $(TDATA) | \
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
+ -L leapseconds - backzone ; }
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
+ -L /dev/null $(TDATA)
+ $(AWK) '/^Rule/' $(TDATA) | \
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
+ -L /dev/null - backzone
+
+posix_right_packrat: posix_packrat leapseconds backzone
+ rm -fr $(DESTDIR)$(TZDIR)-posix
+ ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
+ { $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
+ -L /dev/null $(TDATA) && \
+ $(AWK) '/^Rule/' $(TDATA) | \
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
+ -L /dev/null - backzone ; }
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
+ -L leapseconds $(TDATA)
+ $(AWK) '/^Rule/' $(TDATA) | \
+ $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
+ -L leapseconds - backzone
+
zones: $(REDO)
libtz.a: $(LIBOBJS)
@@ -660,6 +699,6 @@ zic.o: private.h tzfile.h version.h
.PHONY: check check_character_set check_links
.PHONY: check_public check_sorted check_tables
.PHONY: check_time_t_alternatives check_web check_white_space clean clean_misc
-.PHONY: install maintainer-clean names posix_packrat posix_only posix_right
-.PHONY: public right_only right_posix signatures tarballs typecheck
-.PHONY: zonenames zones
+.PHONY: install maintainer-clean names posix_only posix_packrat posix_right
+.PHONY: posix_right_packrat public right_only right_packrat right_posix
+.PHONY: right_posix_packrat signatures tarballs typecheck zonenames zones
diff --git a/NEWS b/NEWS
index a3e9e10..3263a00 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,14 @@ Unreleased, experimental changes
This simplifies the code and is consistent with zdump.c.
(Problem reported by Christos Zoulas.)
+ Changes affecting build procedure
+
+ The 'REDO' Makefile macro now supports additional values
+ 'posix_right_packrat', 'right_packrat', and 'right_posix_packrat'.
+ These extend 'posix_right', 'right_only', and 'right_posix' in the
+ same way that 'posix_packrat' extends 'posix_only', incorporating
+ information from the 'backzone' file into the data sets.
+
Changes affecting documentation
The tzfile man page now documents that transition times denote the
--
2.5.1
More information about the tz
mailing list