[tz] [PATCH 4/4] Use a single version number for both code and data.

Paul Eggert eggert at cs.ucla.edu
Wed Jul 25 15:13:22 UTC 2012


* Makefile (VERSION): New macro, superseding ...
(TZCODE_VERSION, TZDATA_VERSION): Remove.  All uses changed.
(version.h): Call the variable TZVERSION, not TZCODE_VERSION.
All uses changed.
(tzselect): Interpolate TZVERSION, not TZCODE_VERSION.
(public): Adjust to new versioning scheme.
* tzselect.ksh (TZVERSION): Rename from TZCODE_VERSION.
* zdump.c, zic.c (main): Use TZVERSION, not TZCODE_VERSION.
---
 Makefile     |   11 +++++------
 tzselect.ksh |    4 ++--
 zdump.c      |    2 +-
 zic.c        |    2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 270fbaa..510d77f 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,7 @@
 # 2009-05-17 by Arthur David Olson.
 
 # Version numbers of the code and data distributions.
-TZCODE_VERSION = tzcode2012c
-TZDATA_VERSION = tzdata2012d
+VERSION = 2012d
 
 # Change the line below for your time zone (after finding the zone you want in
 # the time zone files, or adding it to a time zone file).
@@ -327,7 +326,7 @@ INSTALL:	ALL install date.1
 
 version.h:
 		echo >$@ \
-		  'static char const TZCODE_VERSION[]="$(TZCODE_VERSION)";'
+		  'static char const TZVERSION[]="tz$(VERSION)";'
 
 zdump:		$(TZDOBJS)
 		$(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@
@@ -379,7 +378,7 @@ tzselect:	tzselect.ksh
 		sed \
 			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
 			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
-			-e 's|\(TZCODE_VERSION\)=.*|\1=$(TZCODE_VERSION)|' \
+			-e 's|\(TZVERSION\)=.*|\1=tz$(VERSION)|' \
 			<$? >$@
 		chmod +x $@
 
@@ -437,10 +436,10 @@ public:		$(ENCHILADA) set-timestamps
 		$(AWK) -f checktab.awk $(PRIMARY_YDATA)
 		LC_ALL=C && export LC_ALL && \
 		tar $(TARFLAGS) -cf - $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | \
-		  gzip $(GZIPFLAGS) > $(TZCODE_VERSION).tar.gz
+		  gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz
 		LC_ALL=C && export LC_ALL && \
 		tar $(TARFLAGS) -cf - $(DATA) | \
-		  gzip $(GZIPFLAGS) > $(TZDATA_VERSION).tar.gz
+		  gzip $(GZIPFLAGS) > tzdata$(VERSION).tar.gz
 
 typecheck:
 		make clean
diff --git a/tzselect.ksh b/tzselect.ksh
index 3ebaaa7..9e8ceea 100644
--- a/tzselect.ksh
+++ b/tzselect.ksh
@@ -1,6 +1,6 @@
 #! /bin/ksh
 
-TZCODE_VERSION=see_Makefile
+TZVERSION=see_Makefile
 
 # Ask the user about the time zone, and output the resulting TZ value to stdout.
 # Interact with the user via stderr and stdin.
@@ -55,7 +55,7 @@ EOF
     exit 0
 elif [ "$1" = "--version" ]; then
     cat <<EOF
-tzselect $TZCODE_VERSION
+tzselect $TZVERSION
 EOF
     exit 0
 fi
diff --git a/zdump.c b/zdump.c
index cbd3338..7b96a4f 100644
--- a/zdump.c
+++ b/zdump.c
@@ -282,7 +282,7 @@ char *	argv[];
 	progname = argv[0];
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
-			(void) printf("%s\n", TZCODE_VERSION);
+			(void) printf("%s\n", TZVERSION);
 			exit(EXIT_SUCCESS);
 		} else if (strcmp(argv[i], "--help") == 0) {
 			usage(stdout, EXIT_SUCCESS);
diff --git a/zic.c b/zic.c
index 28d7bcf..4ae31a2 100644
--- a/zic.c
+++ b/zic.c
@@ -497,7 +497,7 @@ char *	argv[];
 	}
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
-			(void) printf("%s\n", TZCODE_VERSION);
+			(void) printf("%s\n", TZVERSION);
 			exit(EXIT_SUCCESS);
 		} else if (strcmp(argv[i], "--help") == 0) {
 			usage(stdout, EXIT_SUCCESS);
-- 
1.7.9.5



More information about the tz mailing list