[tz] [PATCH 1/4] Remove -t ZONETABTYPE option from 'tzselect'.

Paul Eggert eggert at cs.ucla.edu
Wed Sep 11 09:58:43 UTC 2013

This was experimental, and it appears that the tzwinnow
approach will be better.  We need to cut a new stable
release soon, and the -t option might make it harder to
integrate tzwinnow later, so let's omit -t for now.
* .gitignore: Remove time.tab.
* Makefile (ZONETABTYPE): Remove.  All uses removed.
(time.tab): Remove.  All uses removed.
* Theory: Omit discussion of time.tab.
* zone-time.awk: Remove.
* tzselect.8: Omit -t and time.tab.
* tzselect.ksh (ZONETABTYPE): Remove.  All uses removed.
Remove -t ZONETABTYPE option.
* zone.tab: Restore first comment line, since there's no longer
a need to distinguish this file from time.tab.
 .gitignore    |  1 -
 Makefile      | 22 ++++------------------
 Theory        | 10 +++-------
 tzselect.8    | 51 +--------------------------------------------------
 tzselect.ksh  | 13 +++----------
 zone-time.awk | 34 ----------------------------------
 zone.tab      |  2 +-
 7 files changed, 12 insertions(+), 121 deletions(-)
 delete mode 100644 zone-time.awk

diff --git a/.gitignore b/.gitignore
index 18dbbcc..2b93d4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
diff --git a/Makefile b/Makefile
index eb0ea59..9052eeb 100644
--- a/Makefile
+++ b/Makefile
@@ -40,15 +40,6 @@ LOCALTIME=	GMT
 POSIXRULES=	America/New_York
-# Default time zone table type for 'tzselect'.  See tzselect.8 for details.
-# Possible values are:
-# 'time' - for a smaller time zone table
-# 'zone' - for a backward compatible time zone table; it contains
-#   alternative TZ values present for compatibility with older versions of
-#   this software.
 # Also see TZDEFRULESTRING below, which takes effect only
 # if the time zone files cannot be accessed.
@@ -329,11 +320,11 @@ YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
 NDATA=		systemv factory
 SDATA=		solar87 solar88 solar89
-TABDATA=	iso3166.tab time.tab zone.tab
+TABDATA=	iso3166.tab zone.tab
 			leap-seconds.list yearistype.sh
 WEB_PAGES=	tz-art.htm tz-link.htm
-AWK_SCRIPTS=	checktab.awk leapseconds.awk zone-time.awk
+AWK_SCRIPTS=	checktab.awk leapseconds.awk
 MISC=		usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
 			$(WEB_PAGES) $(AWK_SCRIPTS) workman.sh \
@@ -352,8 +343,8 @@ install:	all $(DATA) $(REDO) $(DESTDIR)$(TZLIB) $(MANS)
 		$(ZIC) -y $(YEARISTYPE) \
 		-rm -f $(DESTDIR)$(TZDIR)/iso3166.tab \
-			$(DESTDIR)$(TZDIR)/time.tab $(DESTDIR)$(TZDIR)/zone.tab
-		cp iso3166.tab time.tab zone.tab $(DESTDIR)$(TZDIR)/.
+			$(DESTDIR)$(TZDIR)/zone.tab
+		cp iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/.
 		cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
@@ -430,9 +421,6 @@ posix_right:	posix_only leapseconds
 zones:		$(REDO)
-time.tab:	$(YDATA) zone.tab zone-time.awk
-		$(AWK) -f zone-time.awk $(YDATA) >$@
 		-mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(LIBDIR)
 		ar ru $@ $(LIBOBJS)
@@ -450,7 +438,6 @@ tzselect:	tzselect.ksh
 			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
 			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
 			-e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
-			-e 's|^\(ZONETABTYPE\)=.*|\1=$(ZONETABTYPE)|' \
 			<$? >$@
 		chmod +x $@
@@ -467,7 +454,6 @@ check_web:	$(WEB_PAGES)
 		rm -f core *.o *.out \
-		  time.tab \
 		  date leapseconds tzselect version.h zdump zic yearistype
 clean:		clean_misc
 		rm -f -r tzpublic
diff --git a/Theory b/Theory
index 13b5565..0c1ffdd 100644
--- a/Theory
+++ b/Theory
@@ -357,13 +357,9 @@ in decreasing order of importance:
 The file 'zone.tab' lists geographical locations used to name time
 zone rule files.  It is intended to be an exhaustive list of names
 for geographic regions as described above; this is a subset of the
-Zone entries in the data.  The file 'time.tab' is a simplified
-version of 'zone.tab', the intent being that entries are coalesced
-if their time stamps agree after 1970, which means the entries are
-distinct in 'zone.tab' only because of the abovementioned political
-constraints.  Although a 'zone.tab' location's longitude corresponds
-to its LMT offset with one hour for every 15 degrees east longitude,
-this relationship is not exact and is not true for 'time.tab'.
+names in the data.  Although a 'zone.tab' location's longitude
+corresponds to its LMT offset with one hour for every 15 degrees east
+longitude, this relationship is not exact.
 Older versions of this package used a different naming scheme,
 and these older names are still supported.
diff --git a/tzselect.8 b/tzselect.8
index 39436ae..1dd721a 100644
--- a/tzselect.8
+++ b/tzselect.8
@@ -10,9 +10,6 @@ tzselect \- select a time zone
 .B \-n
 .I limit
 ] [
-.B \-t
-.I zonetabtype
-] [
 .B \-\-help
 ] [
 .B \-\-version
@@ -73,52 +70,8 @@ When
 is used, display the closest
 .I limit
 locations (default 10).
-.BI "\-t " zonetabtype
-Make selections from the time zone table of type
-.I zonetabtype.
-.I zonetabtype
-values include:
-.B time
-A time zone table with a smaller set of zone names.
-.B zone
-A time zone table that also contains alternative zone names, for
-backward compatibility with older versions of this software.  The
-alternative names are not needed for proper operation of time stamps;
-they are present only to avoid surprises with people who are
-accustomed to the old names.  These alternative names arose from
-political issues that are outside the scope of
-.BR tzselect .
-For example, both tables have entries for countries like
-Bosnia, Croatia, and Serbia, which are in a zone where the clocks
-have all agreed since 1970.  Although the
-.B time
-table lists "Europe/Belgrade" for this zone wherever it occurs, the
-.B zone
-table instead lists the names "Europe/Sarajevo", "Europe/Zagreb",
-etc. under Bosnia, Croatia, etc.  This means that the
-.B "\-t\ time"
-option causes
-.B tzselect
-to generate "Europe/Belgrade" for this zone, whereas
-.B "\-t\ zone"
-causes it to generate different names depending on the country,
-names that are equivalent in effect to "Europe/Belgrade".
-The default
-.I zonetabtype
-is system-dependent, so applications that care about the set of
-names that
-.B tzselect
-generates should use the
-.B "\-t"
-option.  Regardless of what options are used, applications should not
-assume that
+Applications should not assume that
 .BR tzselect 's
 output matches the user's political preferences.
@@ -144,8 +97,6 @@ Name of the directory containing time zone data files (default:
 Table of ISO 3166 2-letter country codes and country names.
 Tables of country codes, latitude and longitude, zone names, and
 descriptive comments.
diff --git a/tzselect.ksh b/tzselect.ksh
index 3e7788e..1934dd0 100644
--- a/tzselect.ksh
+++ b/tzselect.ksh
@@ -3,7 +3,6 @@
 PKGVERSION='(tzcode) '
 REPORT_BUGS_TO=tz at iana.org
 # Ask the user about the time zone, and output the resulting TZ value to stdout.
 # Interact with the user via stderr and stdin.
@@ -44,7 +43,7 @@ ZONETABTYPE=zone
-usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT] [-t ZONETABTYPE]
+usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
 Select a time zone interactively.
@@ -60,10 +59,6 @@ Options:
   -n LIMIT
     Display at most LIMIT locations when -c is used (default $location_limit).
-    Use time zone table ZONETABTYPE.  ZONETABTYPE should be one of
-    'time' or 'zone'.
     Output version information.
@@ -72,15 +67,13 @@ Options:
 Report bugs to $REPORT_BUGS_TO."
-while getopts c:n:t:-: opt
+while getopts c:n:-: opt
     case $opt$OPTARG in
 	coord=$OPTARG ;;
 	location_limit=$OPTARG ;;
-    t*)
 	exec echo "$usage" ;;
@@ -100,7 +93,7 @@ esac
 # Make sure the tables are readable.
 	<$f || {
diff --git a/zone-time.awk b/zone-time.awk
deleted file mode 100644
index 5210c1f..0000000
--- a/zone-time.awk
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generate 'time.tab' from 'zone.tab'.  Standard input should be the zic input.
-# This file is in the public domain.
-# Contributed by Paul Eggert.
-$1 == "Link" { link[$3] = $2 }
-END {
-    FS = "\t"
-    while (getline < "zone.tab") {
-	line = $0
-	if (line ~ /^# TZ zone descriptions/)
-	    line = "# TZ zone descriptions, with a smaller set of zone names"
-	if (line ~ /^# 4.  Comments;/) {
-	    print "#     Zones can cross country-code boundaries, so the"
-	    print "#     location named by column 3 need not lie in the"
-	    print "#     locations identified by columns 1 or 2."
-	}
-	if (line ~ /^[^#]/) {
-	    code = $1
-	    target = $3
-	    while (link[target])
-		target = link[target]
-	    if (already_seen[code, target])
-		continue
-	    already_seen[code, target] = 1
-	    line = code "\t" $2 "\t" target
-	    if ($4)
-		line = line "\t" $4
-	}
-	print line
-    }
diff --git a/zone.tab b/zone.tab
index 7d4c575..fa4df5f 100644
--- a/zone.tab
+++ b/zone.tab
@@ -1,4 +1,4 @@
-# TZ zone descriptions, with alternative zone names for backward compatibility
+# TZ zone descriptions
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.

More information about the tz mailing list