Skip to content

Commit

Permalink
Make bug-reporting address more configurable.
Browse files Browse the repository at this point in the history
Based on a patch by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018452.html>.
* Makefile (BUGEMAIL): New macro.
(version.h, tzselect): Use it to define REPORT_BUGS_TO.
* tzselect.ksh (REPORT_BUGS_TO): New variable, used for --help.
* zdump.c, zic.c (usage): Use REPORT_BUGS_TO for --help.
  • Loading branch information
eggert committed Nov 13, 2012
1 parent dec96c0 commit a435f9f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ PACKAGE= tzcode
# Version numbers of the code and data distributions.
VERSION= 2012j

# 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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -396,6 +400,7 @@ tzselect: tzselect.ksh
-e 's|#!/bin/bash|#!$(KSHELL)|g' \
-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
-e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
<$? >$@
Expand Down
3 changes: 2 additions & 1 deletion tzselect.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions zdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions zic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a435f9f

Please sign in to comment.