Project

General

Profile

Actions

Feature #13467

closed

Update tzdata to 2021a

Added by Robert Mustacchi over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
system data
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

I noticed that we were behind on tzdata, so this updates it to the latest version of this data.

Actions #1

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1181
Actions #2

Updated by Robert Mustacchi over 2 years ago

  • Subject changed from Update tzdata to 2020f to Update tzdata to 2021a
Actions #3

Updated by Robert Mustacchi over 2 years ago

To test this, I first manually verified that the primary changes to actual zones -- Australia/Hobart and Australia/Currie both still worked when manually specifying them via the TZ environment variable. Next, I wrote the following small program that uses libzoneinfo:

#include <stdio.h>
#include <libzoneinfo.h>
#include <err.h>
#include <stdlib.h>

int
main(void)
{
        int i, nconts;
        struct tz_continent *cont, *ocont;

        nconts = get_tz_continents(&cont);
        if (nconts < 0) {
                err(EXIT_FAILURE, "failed to get contintent");
        }

        ocont = cont;
        for (i = 0; cont != NULL && i < nconts; i++,
            cont = cont->ctnt_next) {
                int ncountries, c;
                struct tz_country *country, *ocountry;

                (void) printf("%s\n", cont->ctnt_name);

                ncountries = get_tz_countries(&country, cont);
                if (ncountries < 0) {
                        err(EXIT_FAILURE, "failed to get countries" );
                }

                ocountry = country;
                for (c = 0; country != NULL && c < ncountries; c++,
                    country = country->ctry_next) {
                        int ntzs, t;
                        struct tz_timezone *tz, *otz;

                        (void) printf("\t%s\n", country->ctry_id_desc);

                        ntzs = get_timezones_by_country(&tz, country);
                        otz = tz;
                        if (ntzs < 0) {
                                err(EXIT_FAILURE, "failed to get timezones");
                        }
                        for (t = 0; tz != NULL && t < ntzs; t++,
                            tz = tz->tz_next) {
                                (void) printf("\t\t\t%s\n", tz->tz_name);
                        }

                        free_timezones(otz);
                }

                free_tz_countries(ocountry);
        }

        free_tz_continents(ocont);
}

This basically dumps which TZs are associated with each country and continent. I found that the set of data was identical before and after which matches what we expect as this upgrade didn't add or remove any zones.

Actions #4

Updated by Electric Monk over 2 years ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

git commit f915e6d33fea11e547f382c9f44614aa99739ba5

commit  f915e6d33fea11e547f382c9f44614aa99739ba5
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-02-04T04:06:00.000Z

    13467 Update tzdata to 2021a
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF