Update from tzcode2009i.
This commit is contained in:
parent
a468a1d4a9
commit
5fb55a68c1
@ -1,5 +1,9 @@
|
|||||||
2009-06-15 Ulrich Drepper <drepper@redhat.com>
|
2009-06-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* timezone/tzselect.ksh: Update from tzcode2009i.
|
||||||
|
* timezone/zdump.c: Likewise.
|
||||||
|
* timezone/zic.c: Likewise.
|
||||||
|
|
||||||
* timezone/africa: Update from tzdata2009i.
|
* timezone/africa: Update from tzdata2009i.
|
||||||
* timezone/antarctica: Likewise.
|
* timezone/antarctica: Likewise.
|
||||||
* timezone/asia: Likewise.
|
* timezone/asia: Likewise.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#! @KSH@
|
#! @KSH@
|
||||||
|
|
||||||
# '@(#)tzselect.ksh 8.1'
|
VERSION='@(#)tzselect.ksh 8.2'
|
||||||
|
|
||||||
# Ask the user about the time zone, and output the resulting TZ value to stdout.
|
# Ask the user about the time zone, and output the resulting TZ value to stdout.
|
||||||
# Interact with the user via stderr and stdin.
|
# Interact with the user via stderr and stdin.
|
||||||
@ -45,6 +45,21 @@
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "--help" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
Usage: tzselect
|
||||||
|
Select a time zone interactively.
|
||||||
|
|
||||||
|
Report bugs to tz@elsie.nci.nih.gov.
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
elif [ "$1" = "--version" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
tzselect $VERSION
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Make sure the tables are readable.
|
# Make sure the tables are readable.
|
||||||
TZ_COUNTRY_TABLE=$TZDIR/iso3166.tab
|
TZ_COUNTRY_TABLE=$TZDIR/iso3166.tab
|
||||||
TZ_ZONE_TABLE=$TZDIR/zone.tab
|
TZ_ZONE_TABLE=$TZDIR/zone.tab
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
static char elsieid[] = "@(#)zdump.c 8.6";
|
/*
|
||||||
|
** This file is in the public domain, so clarified as of
|
||||||
|
** 2009-05-17 by Arthur David Olson.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static char elsieid[] = "@(#)zdump.c 8.9";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This code has been made independent of the rest of the time
|
** This code has been made independent of the rest of the time
|
||||||
@ -230,6 +235,17 @@ const char * const zone;
|
|||||||
warned = TRUE;
|
warned = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(const char *progname, FILE *stream, int status)
|
||||||
|
{
|
||||||
|
(void) fprintf(stream,
|
||||||
|
_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
|
||||||
|
\n\
|
||||||
|
Report bugs to tz@elsie.nci.nih.gov.\n"),
|
||||||
|
progname, progname);
|
||||||
|
exit(status);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
@ -266,6 +282,8 @@ char * argv[];
|
|||||||
if (strcmp(argv[i], "--version") == 0) {
|
if (strcmp(argv[i], "--version") == 0) {
|
||||||
(void) printf("%s\n", elsieid);
|
(void) printf("%s\n", elsieid);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
} else if (strcmp(argv[i], "--help") == 0) {
|
||||||
|
usage(progname, stdout, EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
vflag = 0;
|
vflag = 0;
|
||||||
cutarg = NULL;
|
cutarg = NULL;
|
||||||
@ -275,10 +293,7 @@ char * argv[];
|
|||||||
else cutarg = optarg;
|
else cutarg = optarg;
|
||||||
if ((c != EOF && c != -1) ||
|
if ((c != EOF && c != -1) ||
|
||||||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
|
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
|
||||||
(void) fprintf(stderr,
|
usage(progname, stderr, EXIT_FAILURE);
|
||||||
_("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
|
|
||||||
progname, progname);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
if (vflag) {
|
if (vflag) {
|
||||||
if (cutarg != NULL) {
|
if (cutarg != NULL) {
|
||||||
@ -349,13 +364,9 @@ _("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
|
|||||||
(void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
|
(void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
|
||||||
}
|
}
|
||||||
for ( ; ; ) {
|
for ( ; ; ) {
|
||||||
if (t >= cuthitime)
|
if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12)
|
||||||
break;
|
break;
|
||||||
newt = t + SECSPERHOUR * 12;
|
newt = t + SECSPERHOUR * 12;
|
||||||
if (newt >= cuthitime)
|
|
||||||
break;
|
|
||||||
if (newt <= t)
|
|
||||||
break;
|
|
||||||
newtmp = localtime(&newt);
|
newtmp = localtime(&newt);
|
||||||
if (newtmp != NULL)
|
if (newtmp != NULL)
|
||||||
newtm = *newtmp;
|
newtm = *newtmp;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
** 2006-07-17 by Arthur David Olson.
|
** 2006-07-17 by Arthur David Olson.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char elsieid[] = "@(#)zic.c 8.17";
|
static char elsieid[] = "@(#)zic.c 8.19";
|
||||||
|
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
#include "locale.h"
|
#include "locale.h"
|
||||||
@ -156,7 +156,7 @@ static void stringzone(char * result,
|
|||||||
const struct zone * zp, int ntzones);
|
const struct zone * zp, int ntzones);
|
||||||
static void setboundaries(void);
|
static void setboundaries(void);
|
||||||
static zic_t tadd(zic_t t1, long t2);
|
static zic_t tadd(zic_t t1, long t2);
|
||||||
static void usage(void);
|
static void usage(FILE *stream, int status);
|
||||||
static void writezone(const char * name, const char * string);
|
static void writezone(const char * name, const char * string);
|
||||||
static int yearistype(int year, const char * type);
|
static int yearistype(int year, const char * type);
|
||||||
|
|
||||||
@ -454,13 +454,15 @@ const char * const string;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(FILE *stream, int status)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr, _("%s: usage is %s \
|
(void) fprintf(stream, _("%s: usage is %s \
|
||||||
[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
|
[ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
|
||||||
\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
|
\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
|
||||||
progname, progname);
|
\n\
|
||||||
exit(EXIT_FAILURE);
|
Report bugs to tz@elsie.nci.nih.gov.\n"),
|
||||||
|
progname, progname);
|
||||||
|
exit(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * psxrules;
|
static const char * psxrules;
|
||||||
@ -498,11 +500,13 @@ char * argv[];
|
|||||||
if (strcmp(argv[i], "--version") == 0) {
|
if (strcmp(argv[i], "--version") == 0) {
|
||||||
(void) printf("%s\n", elsieid);
|
(void) printf("%s\n", elsieid);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
} else if (strcmp(argv[i], "--help") == 0) {
|
||||||
|
usage(stdout, EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF && c != -1)
|
while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF && c != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
default:
|
default:
|
||||||
usage();
|
usage(stderr, EXIT_FAILURE);
|
||||||
case 'd':
|
case 'd':
|
||||||
if (directory == NULL)
|
if (directory == NULL)
|
||||||
directory = optarg;
|
directory = optarg;
|
||||||
@ -561,7 +565,7 @@ _("%s: More than one -L option specified\n"),
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
|
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
|
||||||
usage(); /* usage message by request */
|
usage(stderr, EXIT_FAILURE); /* usage message by request */
|
||||||
if (directory == NULL)
|
if (directory == NULL)
|
||||||
directory = TZDIR;
|
directory = TZDIR;
|
||||||
if (yitcommand == NULL)
|
if (yitcommand == NULL)
|
||||||
@ -1991,7 +1995,7 @@ const int zonecount;
|
|||||||
min_year = max_year = EPOCH_YEAR;
|
min_year = max_year = EPOCH_YEAR;
|
||||||
if (leapseen) {
|
if (leapseen) {
|
||||||
updateminmax(leapminyear);
|
updateminmax(leapminyear);
|
||||||
updateminmax(leapmaxyear);
|
updateminmax(leapmaxyear + (leapmaxyear < INT_MAX));
|
||||||
}
|
}
|
||||||
for (i = 0; i < zonecount; ++i) {
|
for (i = 0; i < zonecount; ++i) {
|
||||||
zp = &zpfirst[i];
|
zp = &zpfirst[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user