Skip to content

Commit

Permalink
One line per metadatum in tzdata.zi
Browse files Browse the repository at this point in the history
With the new metadata, version lines could be long.  E.g., 'make
DATAFORM=rearguard REDO=posix_only PACKRATDATA=backzone BACKWARD='
could generate a tzdata.zi line like this:
  # version 2018e-57-gba7f088,dataform=rearguard,redo=posix_only,ddeps=(backzone,!backward)
which is quite a mouthful and is stretching the definition of
"version".  To avoid the problem, output a separate comment line
for each metadata component instead, like this:
  # version 2018e-57-gba7f088
  # dataform rearguard
  # redo posix_only
  # ddeps backzone !backward
This is easier to read and to parse and should scale better
if we add more metadata later.
* NEWS: Mention this.
* zishrink.awk: Output a separate line for each metadatum.

2018-07-21  Paul Eggert  <eggert@cs.ucla.edu>

Use space, not comma, in tzdata.zi "# version"
* zishrink.awk: Use space instead of comma to separate original
version string from auxiliary configuration information.  This
saves two bytes and (more important) is easier for humans to read.
  • Loading branch information
eggert committed Jul 31, 2018
1 parent ba7f088 commit 5c00561
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ Unreleased, experimental changes
tzdata.zi is now more stable from release to release. (Problem
noted by Tom Lane.) It is also a bit shorter.

tzdata.zi's version comment now contains information about which
data format was selected, which input files were used, and how
leap seconds are treated. (Problems noted by Lester Caine and
Brian Inglis.) If the Makefile defaults are used, no text is
appended to the version comment, for backward compatibility.
A redistributor intending to alter its copy of the files should
also append "-SOMETHING" to the 'version' file's first line, where
"SOMETHING" identifies what was changed.
tzdata.zi now can contain comment lines documenting configuration
information, such as which data format was selected, which input
files were used, and how leap seconds are treated. (Problems
noted by Lester Caine and Brian Inglis.) If the Makefile defaults
are used these comment lines are absent, for backward
compatibility. A redistributor intending to alter its copy of the
files should also append "-LABEL" to the 'version' file's first
line, where "LABEL" identifies the redistributor's change.


Release 2018e - 2018-05-01 23:42:51 -0700
Expand Down
20 changes: 10 additions & 10 deletions zishrink.awk
Original file line number Diff line number Diff line change
Expand Up @@ -287,30 +287,30 @@ BEGIN {
# that affect the output of this script, you should append '-SOMETHING'
# to the contents of 'version', where SOMETHING identifies what was changed.

if (dataform != "main") {
version = version ",dataform=" dataform
}
if (redo != "posix_right") {
version = version ",redo=" redo
}
ndeps = split(deps, dep)
ddeps = ""
for (i = 1; i <= ndeps; i++) {
if (default_dep[dep[i]]) {
default_dep[dep[i]]++
} else {
ddeps = ddeps "," dep[i]
ddeps = ddeps " " dep[i]
}
}
for (d in default_dep) {
if (default_dep[d] == 1) {
ddeps = ddeps ",!" d
ddeps = ddeps " !" d
}
}
print "# version", version
if (dataform != "main") {
print "# dataform", dataform
}
if (redo != "posix_right") {
print "# redo " redo
}
if (ddeps) {
version = version ",ddeps=(" substr(ddeps, 2) ")"
print "# ddeps" ddeps
}
print "# version", version
print "# This zic input file is in the public domain."

prehash_rule_names()
Expand Down

0 comments on commit 5c00561

Please sign in to comment.