Skip to content

Commit

Permalink
Squashed 'tz/' changes from 95ecc37d2..32a4af56f
Browse files Browse the repository at this point in the history
b61a7acb4 Release 2022b
39dc54c76 Use more-official URL for Chile change
cc9d7b92f Fix typo in previous commit.
711b46f8f Chile's DST is delayed by a week in September 2022
12be3e4ce Omit pacificnew from tailored vanguard tarballs
9b665ce9a Put 'leapseconds' etc. into tailored tarballs
35fa37fbb Finish duplicate-since-1970 moves
0b925f6d8 Move nine more zones to ‘backzone’
0f9ac4ff2 Improve zishrink after PACKRATLIST
3be5b73fe Add PACKRATLIST build-time option
406d29f4a Remove hack to work around circa-2006 zic issue
4000ea353 Simplify subseconds for Asia/Jakarta
4b78b8bb3 Don’t generate subseconds in vanguard form
ff6ead112 Add a couple of #STDOFF comments
6b32cae26 Simplify subsecond precision handling
26e522baa Check that ziguard substitutions revert
de89db718 Omit tiny 1906 change in Vietnam
4d39a0ee9 Apply subsecond precision to Amsterdam Mean Time
4f8ac112b Vanguard form now uses subsecond precision
4c7a2921c Omit tiny 1880 change in Dublin
4feb18cd4 * theory.html: Source data can do subseconds.
9cd5f5339 * europe (Atlantic/Madeira): Fix typo in vanguard section.
bffc26e90 * leapseconds.awk: no longer executable
42eda0722 Fix location of recently added posix_packrat line.
bd548f646 Remove obsolescent posix_packrat target
13a0921ac New ‘make’ target tailored_tarballs
52f8d925f * zic.8: Don’t pagebreak just after "EXTENDED EXAMPLE".
e4374a954 Fix minor glitches in .txt output
83a2b918a * tz-link.html: Link to the unsmear library.
dfe016bc5 No leap second on 2022-12-31
a249a0c64 Use %z in vanguard form
0deba9f3e * europe: Fix a few more "Kiev"s in comments.
729c2d34d Refactor ziguard.awk
e0d136f49 * europe, backzone: Correct and move Liechtenstein comment.
634b9361d * backward: Add backward-compatibility comment.
dd0a679c9 * NEWS: Mention LOCALTIME change.
172d43570 Change LOCALTIME default back to Factory
50df7d69f gmtime etc. now say "UTC", not "GMT"
bf8aa9414 Remove ancient asctime.c cruft
3da46e2af Avoid C macros when this is easy
4551a1ae6 Remove macros duplicated from private.h
a4095bda6 Improve #if indenting
918e10e89 * zic.8: fix minus typo
eaa6bf832 Add -R option to zic
a9bb98690 Chile's 1946/7 DST started early
0b094598d April Fool note
7ffb999b1 Chile’s 1946/7 time was DST
37c27ce43 Iran 1977 fallback was 10-20 not 09-23
93b40c75a Upgrade GCC_DEBUG_FLAGS to GCC 12
ce8774c37 Document that zic -r doesn’t necessarily shrink
5e7de49c3 Fix bug with zic -r cutoff before 1st transition
1fa2731ce Refactor by using max and min macros
0e8f0b06a strftime %s no longer worries about mktime failure
6f2e9b693 Stricter mktime -1 heuristic in strftime
d8655c6ae * asia: Commentary corrections from Michael Deckers.
52061c178 Correct Iran transitions in 1977 and 1978
ec42353f5 Fix bug uncovered by recent change to Iran history
6af4cda4f Refactor outzone
538c64e13 Iran DST changes in late 1970s
3d605c53f Iran switched to standard time in 1935
4742526b7 Prefer specified time for vestigial variables
9fa1a5395 * NEWS: Mention other Ukrainian locations.
8b6a387b1 Go back to 2021e Morocco rearguard workaround
fd03aae45 Add </p> to end element.
726ef41a5 Clarify old-version doc
1fd3bd4c2 Check that FORMAT has / only with rules
e18c7ac28 * zic.8: Say that STDOFF lacks suffix letters.
221bf5fe3 Simplify Asia/Dushanbe
6c018546a Remove already-obsolete link
66b18d983 Iran will stop DST in 2023
6f96f5590 Follow Shanks for Crimea 1994/1996
b5d501457 Simplify Europe/Simferopol
a012287a6 Avoid “traditional” and “popular”
e13e9c531 Rename Europe/Kiev to Europe/Kyiv
1f023d598 Cite 2022 Magallanes decree
ac377a1f0 Simplify field memory allocation in zic
65f616d2e zic now checks input bytes more carefully
ce5b21b84 Omit or paraphrase some quotes
b6a8aeca9 Improve Morocco 2087 rearguard workaround
a0f887648 Fix Dawson Creek latitude (thanks to Michael Ewert).
64c5d196f Fix spelling and grammar in commentary
32a9a151e Fix some typos in NEWS, africa and australasia.

git-subtree-dir: tz
git-subtree-split: 32a4af56f4afa83720840dc4e325636428283b84
  • Loading branch information
stub42 committed Aug 11, 2022
1 parent 9e15fad commit 301a880
Show file tree
Hide file tree
Showing 32 changed files with 1,938 additions and 1,275 deletions.
160 changes: 119 additions & 41 deletions Makefile
Expand Up @@ -33,7 +33,7 @@ DATAFORM= main
# make zonenames
# to get a list of the values you can use for LOCALTIME.

LOCALTIME= GMT
LOCALTIME= Factory

# The POSIXRULES macro controls interpretation of nonstandard and obsolete
# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules.
Expand Down Expand Up @@ -176,12 +176,19 @@ TZDATA_TEXT= leapseconds tzdata.zi

BACKWARD= backward

# If you want out-of-scope and often-wrong data from the file 'backzone', use
# If you want out-of-scope and often-wrong data from the file 'backzone',
# but only for entries listed in the backward-compatibility file zone.tab, use
# PACKRATDATA= backzone
# PACKRATLIST= zone.tab
# If you want all the 'backzone' data, use
# PACKRATDATA= backzone
# PACKRATLIST=
# To omit this data, use
# PACKRATDATA=
# PACKRATLIST=

PACKRATDATA=
PACKRATLIST=

# The name of a locale using the UTF-8 encoding, used during self-tests.
# The tests are skipped if the name does not appear to work on this system.
Expand Down Expand Up @@ -264,7 +271,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
$(GCC_INSTRUMENT) \
-Wall -Wextra \
-Walloc-size-larger-than=100000 -Warray-bounds=2 \
-Wbad-function-cast -Wcast-align=strict -Wdate-time \
-Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \
-Wdeclaration-after-statement -Wdouble-promotion \
-Wduplicated-branches -Wduplicated-cond \
-Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
Expand All @@ -278,7 +285,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
-Wsuggest-attribute=const -Wsuggest-attribute=format \
-Wsuggest-attribute=malloc \
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
-Wtrampolines -Wundef -Wuninitialized -Wunused-macros \
-Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \
-Wvariadic-macros -Wvla -Wwrite-strings \
-Wno-address -Wno-format-nonliteral -Wno-sign-compare \
-Wno-type-limits -Wno-unused-parameter
Expand Down Expand Up @@ -448,6 +455,9 @@ UNUSUAL_OK_IPA = u̯
# useful in commentary.
UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
# Put this in a bracket expression to match spaces.
s = [:space:]
# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
Expand Down Expand Up @@ -521,8 +531,9 @@ TDATA= $(YDATA) $(NDATA) $(BACKWARD)
ZONETABLES= zone1970.tab zone.tab
TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS= leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \
$(PACKRATDATA) $(PACKRATLIST)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST)
DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
leapseconds $(ZONETABLES)
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
Expand All @@ -534,8 +545,9 @@ TZS= to$(TZS_YEAR).tzs
TZS_NEW= to$(TZS_YEAR)new.tzs
TZS_DEPS= $(YDATA) asctime.c localtime.c \
private.h tzfile.h zdump.c zic.c
TZDATA_DIST = $(COMMON) $(DATA) $(MISC)
# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi
ENCHILADA = $(EIGHT_YARDS) $(TZS)
# Consult these files when deciding whether to rebuild the 'version' file.
Expand Down Expand Up @@ -608,13 +620,17 @@ version: $(VERSION_DEPS)
printf '%s\n' "$$V" >$@.out
mv $@.out $@
# These files can be tailored by setting BACKWARD and PACKRATDATA.
# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
$(AWK) \
-v DATAFORM=`expr $@ : '\(.*\).zi'` \
-v PACKRATDATA='$(PACKRATDATA)' \
-v PACKRATLIST='$(PACKRATLIST)' \
-f ziguard.awk \
$(TDATA) $(PACKRATDATA) >$@.out
mv $@.out $@
# This file has a version comment that attempts to capture any tailoring
# via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO.
tzdata.zi: $(DATAFORM).zi version zishrink.awk
version=`sed 1q version` && \
LC_ALL=C $(AWK) \
Expand Down Expand Up @@ -652,6 +668,7 @@ INSTALLARGS = \
DESTDIR='$(DESTDIR)' \
LEAPSECONDS='$(LEAPSECONDS)' \
PACKRATDATA='$(PACKRATDATA)' \
PACKRATLIST='$(PACKRATLIST)' \
TZDEFAULT='$(TZDEFAULT)' \
TZDIR='$(TZDIR)' \
ZIC='$(ZIC)'
Expand Down Expand Up @@ -690,11 +707,6 @@ posix_right: posix_only
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
# This obsolescent rule is present for backwards compatibility with
# tz releases 2014g through 2015g. It should go away eventually.
posix_packrat: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
zones: $(REDO)
# dummy.zd is not a real file; it is mentioned here only so that the
Expand Down Expand Up @@ -755,8 +767,8 @@ tzselect: tzselect.ksh version
mv $@.out $@
check: check_character_set check_white_space check_links \
check_name_lengths check_sorted \
check_tables check_web check_zishrink check_tzs
check_name_lengths check_slashed_abbrs check_sorted \
check_tables check_web check_ziguard check_zishrink check_tzs
check_character_set: $(ENCHILADA)
test ! '$(UTF8_LOCALE)' || \
Expand All @@ -780,19 +792,28 @@ check_white_space: $(ENCHILADA)
patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
! grep -En "$$pat" \
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
! grep -n '[[:space:]]$$' \
! grep -n '[$s]$$' \
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
touch $@
PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
FILE_NAME_COMPONENT_TOO_LONG = \
$(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+
FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15}
check_name_lengths: $(TDATA_TO_CHECK) backzone
! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
$(TDATA_TO_CHECK) backzone
touch $@
PRECEDES_STDOFF = ^(Zone[$s]+[^$s]+)?[$s]+
STDOFF = [-+]?[0-9:.]+
RULELESS_SAVE = (-|$(STDOFF)[sd]?)
RULELESS_SLASHED_ABBRS = \
$(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/
check_slashed_abbrs: $(TDATA_TO_CHECK)
! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK)
touch $@
CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
Expand Down Expand Up @@ -832,11 +853,19 @@ check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html:
test ! -s $@.out || { cat $@.out; exit 1; }
mv $@.out $@
check_ziguard: rearguard.zi vanguard.zi ziguard.awk
$(AWK) -v DATAFORM=rearguard -f ziguard.awk vanguard.zi | \
diff -u rearguard.zi -
$(AWK) -v DATAFORM=vanguard -f ziguard.awk rearguard.zi | \
diff -u vanguard.zi -
touch $@
# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
check_zishrink: check_zishrink_posix check_zishrink_right
check_zishrink_posix check_zishrink_right: \
zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
zic leapseconds $(PACKRATDATA) $(PACKRATLIST) \
$(TDATA) $(DATAFORM).zi tzdata.zi
rm -fr $@.dir $@-t.dir $@-shrunk.dir
mkdir $@.dir $@-t.dir $@-shrunk.dir
case $@ in \
Expand All @@ -845,8 +874,8 @@ check_zishrink_posix check_zishrink_right: \
esac && \
$(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
$(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
case $(DATAFORM) in \
main) \
case $(DATAFORM),$(PACKRATLIST) in \
main,) \
$(ZIC) $$leap -d $@-t.dir $(TDATA) && \
$(AWK) '/^Rule/' $(TDATA) | \
$(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
Expand Down Expand Up @@ -967,6 +996,10 @@ check_public: $(VERSION_DEPS)
rm public.dir/main.zi
cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi
public.dir/zic -d public.dir/zoneinfo main.zi
rm public.dir/main.zi
cd public.dir && \
$(MAKE) PACKRATDATA=backzone PACKRATLIST=zone.tab main.zi
public.dir/zic -d public.dir/zoneinfo main.zi
:
rm -fr public.dir
touch $@
Expand Down Expand Up @@ -1027,9 +1060,9 @@ REARGUARD_ASC = \
ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
tzdb-$(VERSION).tar.lz.asc
tarballs rearguard_tarballs traditional_tarballs \
tarballs rearguard_tarballs tailored_tarballs traditional_tarballs \
signatures rearguard_signatures traditional_signatures: \
version set-timestamps.out rearguard.zi
version set-timestamps.out rearguard.zi vanguard.zi
VERSION=`cat version` && \
$(MAKE) AWK='$(AWK)' VERSION="$$VERSION" $@_version
Expand All @@ -1042,6 +1075,8 @@ rearguard_tarballs_version: \
tzdata$(VERSION)-rearguard.tar.gz
traditional_tarballs_version: \
tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
tailored_tarballs_version: \
tzdata$(VERSION)-tailored.tar.gz
signatures_version: $(ALL_ASC)
rearguard_signatures_version: $(REARGUARD_ASC)
traditional_signatures_version: $(TRADITIONAL_ASC)
Expand All @@ -1055,34 +1090,76 @@ tzcode$(VERSION).tar.gz: set-timestamps.out
tzdata$(VERSION).tar.gz: set-timestamps.out
LC_ALL=C && export LC_ALL && \
tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
tar $(TARFLAGS) -cf - $(TZDATA_DIST) | \
gzip $(GZIPFLAGS) >$@.out
mv $@.out $@
# Create empty files with a reproducible timestamp.
CREATE_EMPTY = TZ=UTC0 touch -mt 202010122253.00
# The obsolescent *rearguard* targets and related macros are present
# for backwards compatibility with tz releases 2018e through 2022a.
# They should go away eventually. To build rearguard tarballs you
# can instead use 'make DATAFORM=rearguard tailored_tarballs'.
tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
rm -fr tzdata$(VERSION)-rearguard.dir
mkdir tzdata$(VERSION)-rearguard.dir
ln $(COMMON) $(DATA) $(MISC) tzdata$(VERSION)-rearguard.dir
cd tzdata$(VERSION)-rearguard.dir && \
rm -f $(TDATA) $(PACKRATDATA) version
rm -fr $@.dir
mkdir $@.dir
ln $(TZDATA_DIST) $@.dir
cd $@.dir && rm -f $(TDATA) $(PACKRATDATA) version
for f in $(TDATA) $(PACKRATDATA); do \
rearf=tzdata$(VERSION)-rearguard.dir/$$f; \
rearf=$@.dir/$$f; \
$(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \
$(SET_TIMESTAMP_DEP) $$rearf ziguard.awk $$f || exit; \
done
sed '1s/$$/-rearguard/' \
<version >tzdata$(VERSION)-rearguard.dir/version
sed '1s/$$/-rearguard/' <version >$@.dir/version
: The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier.
TZ=UTC0 touch -mt 202010122253.00 \
tzdata$(VERSION)-rearguard.dir/pacificnew
touch -cmr version tzdata$(VERSION)-rearguard.dir/version
$(CREATE_EMPTY) $@.dir/pacificnew
touch -cmr version $@.dir/version
LC_ALL=C && export LC_ALL && \
(cd tzdata$(VERSION)-rearguard.dir && \
(cd $@.dir && \
tar $(TARFLAGS) -cf - \
$(COMMON) $(DATA) $(MISC) pacificnew | \
$(TZDATA_DIST) pacificnew | \
gzip $(GZIPFLAGS)) >$@.out
mv $@.out $@
# Create a tailored tarball suitable for TZUpdater and compatible tools.
# For example, 'make DATAFORM=vanguard tailored_tarballs' makes a tarball
# useful for testing whether TZUpdater supports vanguard form.
# The generated tarball is not byte-for-byte equivalent to a hand-tailored
# traditional tarball, as data entries are put into 'etcetera' even if they
# came from some other source file. However, the effect should be the same
# for ordinary use, which reads all the source files.
tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out
rm -fr $@.dir
mkdir $@.dir
: The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier.
cd $@.dir && \
$(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \
`test $(DATAFORM) = vanguard || echo pacificnew`
(grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \
>$@.dir/etcetera
touch -cmr tzdata.zi $@.dir/etcetera
sed -n \
-e '/^# *version *\(.*\)/h' \
-e '/^# *ddeps */H' \
-e '$$!d' \
-e 'g' \
-e 's/^# *version *//' \
-e 's/\n# *ddeps */-/' \
-e 's/ /-/g' \
-e 'p' \
<tzdata.zi >$@.dir/version
touch -cmr version $@.dir/version
links= && \
for file in $(TZDATA_DIST); do \
test -f $@.dir/$$file || links="$$links $$file"; \
done && \
ln $$links $@.dir
LC_ALL=C && export LC_ALL && \
(cd $@.dir && \
tar $(TARFLAGS) -cf - * | gzip $(GZIPFLAGS)) >$@.out
mv $@.out $@
tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
rm -fr tzdb-$(VERSION)
mkdir tzdb-$(VERSION)
Expand Down Expand Up @@ -1134,13 +1211,14 @@ zic.o: private.h tzfile.h version.h
.PHONY: check_web check_zishrink
.PHONY: clean clean_misc dummy.zd force_tzs
.PHONY: install install_data maintainer-clean names
.PHONY: posix_only posix_packrat posix_right public
.PHONY: posix_only posix_right public
.PHONY: rearguard_signatures rearguard_signatures_version
.PHONY: rearguard_tarballs rearguard_tarballs_version
.PHONY: right_only right_posix signatures signatures_version
.PHONY: tarballs tarballs_version
.PHONY: traditional_signatures traditional_signatures_version
.PHONY: traditional_tarballs traditional_tarballs_version
.PHONY: tailored_tarballs tailored_tarballs_version
.PHONY: typecheck
.PHONY: zonenames zones
.PHONY: $(ZDS)

0 comments on commit 301a880

Please sign in to comment.