we should endeavor to update the data files before each PostgreSQL
release.
-At each update, we should check if time zone offsets have changed.
-Just search for the current or previous year and see what has changed.
-Sometimes a country changes its time zone offsets, for example Georgia
-in 2004. Just grepping in the zic database files for 2004 is enough to
-spot such a change. Then the files under tznames/ should be updated.
+While the files under data/ can just be duplicated when updating, manual
+effort is needed to update the time zone abbreviation lists under tznames/.
+These need to be changed whenever new abbreviations are invented or the
+UTC offset associated with an existing abbreviation changes. To detect
+if this has happened, after installing new files under data/ do
+ gmake abbrevs.txt
+which will produce a file showing all abbreviations that are in current
+use according to the data/ files. Compare this to known_abbrevs.txt,
+which is the list that existed last time the tznames/ files were updated.
+Update tznames/ as seems appropriate, then replace known_abbrevs.txt
+in the same commit.
When there has been a new release of Windows (probably including Service
Packs), the list of matching timezones need to be updated. Run the
static zic_t min_time;
static int min_year;
static int noise;
+static int print_abbrevs;
+static zic_t print_cutoff;
static const char *rfilename;
static int rlinenum;
static const char *progname;
usage(FILE *stream, int status)
{
(void) fprintf(stream, _("%s: usage is %s \
-[ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+[ --version ] [ --help ] [ -v ] [ -P ] [ -l localtime ] [ -p posixrules ] \\\n\
\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
\n\
Report bugs to tz@elsie.nci.nih.gov.\n"),
{
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:vPsy:")) != EOF && c != -1)
switch (c)
{
default:
case 'v':
noise = TRUE;
break;
+ case 'P':
+ print_abbrevs = TRUE;
+ print_cutoff = time(NULL);
+ break;
case 's':
(void) printf("%s: -s ignored\n", progname);
break;
puttzcode(gmtoffs[i], fp);
(void) putc(isdsts[i], fp);
(void) putc((unsigned char) indmap[abbrinds[i]], fp);
+
+ /* Print current timezone abbreviations if requested */
+ if (print_abbrevs && pass == 2 &&
+ (ats[i] >= print_cutoff || i == typecnt - 1))
+ {
+ char *thisabbrev = &thischars[indmap[abbrinds[i]]];
+
+ /* filter out assorted junk entries */
+ if (strcmp(thisabbrev, GRANDPARENTED) != 0 &&
+ strcmp(thisabbrev, "zzz") != 0)
+ fprintf(stdout, "%s\t%ld%s\n",
+ thisabbrev,
+ gmtoffs[i],
+ isdsts[i] ? "\tD" : "");
+ }
}
if (thischarcnt != 0)
(void) fwrite((void *) thischars,