From 73665bea0b2da9ab6c0e65089c872f534c20948e Mon Sep 17 00:00:00 2001 From: David Hull Date: Sat, 21 Nov 2015 22:48:36 +0000 Subject: [PATCH] tz-erl: Better document problem when a zone begins or ends using DST. Worked around 2015 Uraguay problem by allowing database to be generated for 2016 instead (with "make DATE=2016-01-01"). --- db/Makefile | 3 ++- db/tz-erl | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/db/Makefile b/db/Makefile index 0da5f4c..44071f0 100644 --- a/db/Makefile +++ b/db/Makefile @@ -1,9 +1,10 @@ TZDIR=tzdata TZ_FILES=$(addprefix $(TZDIR)/, africa antarctica asia australasia backward etcetera europe northamerica southamerica) +tzout: DATE := $(shell date +%F) tzout: $(TZ_FILES) TZ_VERSION=`perl -n -e 'm/^VERSION\s*=\s*(\S+)/ and print $$1;' $(TZDIR)/Makefile`; \ - ./tz-erl --version $$TZ_VERSION -o $@ $^ + ./tz-erl --version $$TZ_VERSION --date $(DATE) -o $@ $^ $(TZ_FILES): $(TZDIR) diff --git a/db/tz-erl b/db/tz-erl index a5534c3..3f41e21 100755 --- a/db/tz-erl +++ b/db/tz-erl @@ -292,7 +292,10 @@ sub zone_line { $rule1 = $rule2 = RULE_NULL; } elsif (scalar(@rules) == 1) { # One active rule. This is a year that DST started or stopped - # being observed + # being observed. erlang_localtime doesn't handle this. If DST + # stopped being observed in this year, don't output a DST rule. + # If DST started being observed, do. (Except that we don't handle + # this yet.) print STDERR Data::Dump::dump(\@rules), "\n"; die "one rule for $name"; $name1 = zonename($format, $rules[0]->[RULE_LETTERS], undef);