From owner-svn-src-all@freebsd.org Wed Jul 17 06:17:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB857A463B; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB5CF681B2; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C2E1A494; Wed, 17 Jul 2019 06:17:28 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6H6HS1Q030273; Wed, 17 Jul 2019 06:17:28 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6H6HSQt030271; Wed, 17 Jul 2019 06:17:28 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201907170617.x6H6HSQt030271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Wed, 17 Jul 2019 06:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350079 - in head: share/zoneinfo usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: in head: share/zoneinfo usr.sbin/tzsetup X-SVN-Commit-Revision: 350079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB5CF681B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2019 06:17:28 -0000 Author: tmunro Date: Wed Jul 17 06:17:27 2019 New Revision: 350079 URL: https://svnweb.freebsd.org/changeset/base/350079 Log: tzsetup: upgrade to zone1970.tab zone.tab is deprecated. Install zone1970.tab alongside it, and use it for tzsetup(8). This is also useful for other applications that need the modern better maintained file. Reviewed by: philip Approved by: allanjude (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20646 Modified: head/share/zoneinfo/Makefile head/usr.sbin/tzsetup/tzsetup.c Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Wed Jul 17 04:13:46 2019 (r350078) +++ head/share/zoneinfo/Makefile Wed Jul 17 06:17:27 2019 (r350079) @@ -115,6 +115,8 @@ install-zoneinfo: .endfor ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ + ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: # Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jul 17 04:13:46 2019 (r350078) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jul 17 06:17:27 2019 (r350079) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" +#define _PATH_ZONETAB "/usr/share/zoneinfo/zone1970.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" #define _PATH_LOCALTIME "/etc/localtime" @@ -217,7 +217,7 @@ struct continent { int nitems; }; -static struct continent africa, america, antarctica, arctic, asia, atlantic; +static struct continent africa, america, antarctica, asia, atlantic; static struct continent australia, europe, indian, pacific, utc; static struct continent_names { @@ -227,7 +227,6 @@ static struct continent_names { { "Africa", &africa }, { "America", &america }, { "Antarctica", &antarctica }, - { "Arctic", &arctic }, { "Asia", &asia }, { "Atlantic", &atlantic }, { "Australia", &australia }, @@ -244,21 +243,20 @@ static struct continent_items { { "1", "Africa" }, { "2", "America -- North and South" }, { "3", "Antarctica" }, - { "4", "Arctic Ocean" }, - { "5", "Asia" }, - { "6", "Atlantic Ocean" }, - { "7", "Australia" }, - { "8", "Europe" }, - { "9", "Indian Ocean" }, - { "0", "Pacific Ocean" }, - { "a", "UTC" } + { "4", "Asia" }, + { "5", "Atlantic Ocean" }, + { "6", "Australia" }, + { "7", "Europe" }, + { "8", "Indian Ocean" }, + { "9", "Pacific Ocean" }, + { "0", "UTC" } }; #define NCONTINENTS \ (int)((sizeof(continent_items)) / (sizeof(continent_items[0]))) static dialogMenuItem continents[NCONTINENTS]; -#define OCEANP(x) ((x) == 3 || (x) == 5 || (x) == 8 || (x) == 9) +#define OCEANP(x) ((x) == 4 || (x) == 7 || (x) == 8) static int continent_country_menu(dialogMenuItem *continent) @@ -482,7 +480,7 @@ read_zones(void) FILE *fp; struct continent *cont; size_t len, contlen; - char *line, *tlc, *file, *descr, *p; + char *line, *country_list, *tlc, *file, *descr, *p; int lineno; fp = fopen(path_zonetab, "r"); @@ -498,10 +496,7 @@ read_zones(void) if (line[0] == '#') continue; - tlc = strsep(&line, "\t"); - if (strlen(tlc) != 2) - errx(1, "%s:%d: invalid country code `%s'", - path_zonetab, lineno, tlc); + country_list = strsep(&line, "\t"); /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); /* get continent portion from continent/country */ @@ -521,7 +516,13 @@ read_zones(void) descr = (line != NULL && *line != '\0') ? line : NULL; - add_zone_to_country(lineno, tlc, descr, file, cont); + while (country_list != NULL) { + tlc = strsep(&country_list, ","); + if (strlen(tlc) != 2) + errx(1, "%s:%d: invalid country code `%s'", + path_zonetab, lineno, tlc); + add_zone_to_country(lineno, tlc, descr, file, cont); + } } fclose(fp); }