Make bug-reporting address more configurable
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 i18n.) 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@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 version.h: (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) ' TZVERSION=see_Makefile +REPORT_BUGS_TO=tz@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@iana.org. +Report bugs to $REPORT_BUGS_TO. EOF exit 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\ \n\ -Report bugs to tz@iana.org.\n"), - progname, progname); +Report bugs to %s.\n"), + progname, progname, REPORT_BUGS_TO); exit(status); } 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\ \n\ -Report bugs to tz@iana.org.\n"), - progname, progname); +Report bugs to %s.\n"), + progname, progname, REPORT_BUGS_TO); exit(status); } -- Joseph S. Myers joseph@codesourcery.com
Thanks. In reviewing that I found one problem: it didn't propagate the bug-reporting address into tzselect. I checked it into the unofficial development repository with that additional change, and it should appear in the next release. Here's the URL: http://github.com/eggert/tz/commit/a435f9f0ecafa56d9e0263835836bd0c64cd7307
participants (2)
-
Joseph S. Myers -
Paul Eggert