[tz] Make bug-reporting address more configurable

Joseph S. Myers jsm at polyomino.org.uk
Sat Nov 10 17:19:38 UTC 2012

When distributing programs from tzcode as part of a larger software 
distribution, it can be desirable to redirect user bug reports to the 
bug-reporting system of that distribution as a whole (with a view to then 
passing along reports or fixes where it's determined that they don't 
relate to local modifications or packaging).  This patch moves the 
bug-reporting address from being hardcoded in various strings to being in 
variables that are more convenient to modify in the packaging process.

(Some people may wish to use an email address for bug reports, some a URL 
to a bug tracker and some a URL for instructions on bug reporting.  But 
making the accompanying text configurable rather than just the address 
bit, to accommodate those variations better, would make things worse for 

diff --git a/Makefile b/Makefile
index 5a17164..cbda727 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,9 @@ PACKAGE=	tzcode
 # Version numbers of the code and data distributions.
 VERSION=	2012i
+# Email address for bug reports.
+BUGEMAIL=	tz at iana.org
 # 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).
 # Alternately, if you discover you've got the wrong time zone, you can just
@@ -344,7 +347,8 @@ INSTALL:	ALL install date.1
 		(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
-		 echo 'static char const TZVERSION[]="$(VERSION)";') >$@
+		 echo 'static char const TZVERSION[]="$(VERSION)";' && \
+		 echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@
 zdump:		$(TZDOBJS)
 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
diff --git a/tzselect.ksh b/tzselect.ksh
index 51bafc1..8e66b44 100644
--- a/tzselect.ksh
+++ b/tzselect.ksh
@@ -2,6 +2,7 @@
 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 +45,7 @@ if [ "$1" = "--help" ]; then
 Usage: tzselect
 Select a time zone interactively.
-Report bugs to tz at iana.org.
+Report bugs to $REPORT_BUGS_TO.
 elif [ "$1" = "--version" ]; then
diff --git a/zdump.c b/zdump.c
index 626b09d..9255aff 100644
--- a/zdump.c
+++ b/zdump.c
@@ -272,8 +272,8 @@ usage(FILE * const stream, const int status)
 	(void) fprintf(stream,
 _("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
-Report bugs to tz at iana.org.\n"),
-		       progname, progname);
+Report bugs to %s.\n"),
+		       progname, progname, REPORT_BUGS_TO);
diff --git a/zic.c b/zic.c
index 1964a89..a5202a1 100644
--- a/zic.c
+++ b/zic.c
@@ -426,8 +426,8 @@ usage(FILE *stream, int status)
 [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
 \t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
-Report bugs to tz at iana.org.\n"),
-		       progname, progname);
+Report bugs to %s.\n"),
+		       progname, progname, REPORT_BUGS_TO);

Joseph S. Myers
joseph at codesourcery.com

More information about the tz mailing list