From nobody Thu Jan 27 05:10:02 2022 X-Original-To: dev-commits-ports-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0C65E1973FC9; Thu, 27 Jan 2022 05:10:03 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JkpYk5TvHz4VfF; Thu, 27 Jan 2022 05:10:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643260202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Z7Vwbc161+0IME79PYDme3B+0ukYdL37P2wjH4Ow0I=; b=Z7i9pucOajeLsxv+/k2Og74QTXz03cvHjFPVMx1UvVN6O/2BWKpTTrUBoCgGbXTqME1BtM 44bOQP4WbYK8IscQZPUjRXCwCH1a44D85io80e7fA5U7B6497mT37pkYiz7RgsGuQGasO9 JFXmG6EA2Ddl34yATmIsiHaKR+s/LGCEEMJx2BWbri71F1X4b7rgiieyoJFHSPK1iRifEi gmwcsrPRU5c6EtKpOs+LjjJR/+8dwSDp81MU1l/hyUSlpNcoeDIU+2zlRcQDxQTOJpY6uT hWSeHG3Y7HLKHK3Ags3uAdSVAWgBRGK+dBfxyXiRnHyF7cvQdP3494cRYz1jrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 915DA106E3; Thu, 27 Jan 2022 05:10:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20R5A2bG092355; Thu, 27 Jan 2022 05:10:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20R5A2Cd092352; Thu, 27 Jan 2022 05:10:02 GMT (envelope-from git) Date: Thu, 27 Jan 2022 05:10:02 GMT Message-Id: <202201270510.20R5A2Cd092352@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Cy Schubert Subject: git: 4f66dd04e532 - 2022Q1 - mail/heirloom-mailx: Fix wrong UTC offset for Europe/Dublin List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-branches@freebsd.org X-BeenThere: dev-commits-ports-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/2022Q1 X-Git-Reftype: branch X-Git-Commit: 4f66dd04e532307bfe9ce8c80454b4e530d5bcd8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643260202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Z7Vwbc161+0IME79PYDme3B+0ukYdL37P2wjH4Ow0I=; b=A8w2OEe//hbvAuobRu9gYdAeEzKmWnZUvEbEKqZpIG4H0KTuhaks4sxTWvSok49lFlA96x OSZdwzv4h0HBkOdXc4Ih0tiixIMOwHKM5K8FkCwujzZQGe/reJpup70279tra9tgwXLwTZ ZQNVkU6602SsrV8EWQGpe/MRyHRsabbNQaCqAE+SvQgocbW8NpOdmLlXvmy/F8QcNeiohp 2JYPfRYigQVN0JndVGPyeFW59DdGoFlYkICoVX+jX5sfKLPf7i5bSHlvESpu3ho01UxnxP OiXFjq9ohb6X8kRyS9XtHWFwG1qD3SjtjLbvzo6jZJU/EXyq6nqwzQ6Wzklhyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643260202; a=rsa-sha256; cv=none; b=CGkOCbcPbSyAZkYypF+2PGIe3xQEdmuJ0w2+oLKuRTOT30Sa3sdXVBKiXCvWxW05aeD9BT kmvqEYxLxwXMVi4rvagRN3OQWboIJb/9Jj6CLkg/M2EbVvBl7dXzexG1pFGPf/uU9ufdH5 uIiR+hdkqxHuikUkrz679Ndb+ZADyXczssNC0yvtbgtOZ0VlaYJ3GB1DDklA8JFD06pm80 Ie99GhUXTNIllIbuba5jkCG3vpC6J+FXThSFO6SUS8iWZ5o3pZO7nctBYJeCFHfcEP1A46 oEbzHOJmBYMnjA07+WSAh5UZCOb4wj2R2W3gg4mt8icJqx8qwyduxIScdhjzmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2022Q1 has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=4f66dd04e532307bfe9ce8c80454b4e530d5bcd8 commit 4f66dd04e532307bfe9ce8c80454b4e530d5bcd8 Author: Andrea Biardi AuthorDate: 2022-01-27 02:29:51 +0000 Commit: Cy Schubert CommitDate: 2022-01-27 02:43:09 +0000 mail/heirloom-mailx: Fix wrong UTC offset for Europe/Dublin Somewhere around 2018, the tzdata maintainers (IANA) corrected a historical mistake with the Europe/Dublin timezone. The mistake was rooted in a misunderstanding of whether IST meant "Irish Summer Time" or "Irish Standard Time". The problem was discussed at great length (http://mm.icann.org/pipermail/tz/2018-January/thread.html) and it was concluded that IST really meant Irish *Standard* Time (in constrast with, say, British *Summer* Time), and that this standard time is defined as UTC+0100. This corresponds to the article at https://en.wikipedia.org/wiki/Time_in_the_Republic_of_Ireland and the notes at https://en.wikipedia.org/wiki/Winter_time_(clock_lag); the source archive of tzdata has a long section dedicated to this problem and a large set of official references and links to www.irishstatutebook.ie. Once the question was settled, the only possible solution for keeping the Irish local time in sync with the rest of the world (timezones aside, the local time in Ireland - as understood by common people - is the same as in London and Belfast) was for IANA to _reverse_ the functioning of the DST flag for Ireland. The result is that in the current IANA timezone database (2021e), Europe/Dublin has DST applied in *winter*, with an adjustment of -1h (that is, negative). Digging deeper, one uncovers that there are a few other countries that have (or once had) the same time-switch mechanism as Ireland; amongst others, https://github.com/MenoData/Time4J/issues/742 also concedes that negative DST is a reality. In heirloom mailx, the logic that works out the UTC offset does the right thing up to a point (November 2021, Ireland = UTC+0100), but then upon inspecting tm->tm_isdst it sees that DST is in effect (remember, flag has been reversed, so DST in Ireland is on in winter time) it adds one hour (it should subtract one, because the adjustment is negative, but mailx doesn't know). PR: 260137 Submitted by: Andrea Biardi Reported by: Andrea Biardi MFH: 2022Q1 (cherry picked from commit c4f80928aed6891068ad6cf9be8c4aaff2a62e24) --- mail/heirloom-mailx/Makefile | 2 +- mail/heirloom-mailx/files/patch-head.c | 14 ++++++++++++++ mail/heirloom-mailx/files/patch-imap.c | 30 ++++++++++++++++++++++++++++++ mail/heirloom-mailx/files/patch-sendout.c | 31 +++++++++++++++++++++++++++++-- 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/mail/heirloom-mailx/Makefile b/mail/heirloom-mailx/Makefile index 0bbf3ff46ac4..98d9e9eed479 100644 --- a/mail/heirloom-mailx/Makefile +++ b/mail/heirloom-mailx/Makefile @@ -1,6 +1,6 @@ PORTNAME= mailx PORTVERSION= 12.4 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= mail MASTER_SITES= SF/heirloom/heirloom-${PORTNAME}/${PORTVERSION} PKGNAMEPREFIX= heirloom- diff --git a/mail/heirloom-mailx/files/patch-head.c b/mail/heirloom-mailx/files/patch-head.c new file mode 100644 index 000000000000..546889ebe1bd --- /dev/null +++ b/mail/heirloom-mailx/files/patch-head.c @@ -0,0 +1,14 @@ +--- head.c.orig 2006-03-03 16:01:19.000000000 -0800 ++++ head.c 2022-01-26 18:13:57.270492000 -0800 +@@ -1116,10 +1116,8 @@ + if ((t = combinetime(year, month, day, hour, minute, second)) == + (time_t)-1) + goto invalid; +- tzdiff = t - mktime(gmtime(&t)); + tmptr = localtime(&t); +- if (tmptr->tm_isdst > 0) +- tzdiff += 3600; ++ tzdiff = tmptr->tm_gmtoff; /* seconds east of GMT */ + t -= tzdiff; + return t; + invalid: diff --git a/mail/heirloom-mailx/files/patch-imap.c b/mail/heirloom-mailx/files/patch-imap.c new file mode 100644 index 000000000000..b90d47a85384 --- /dev/null +++ b/mail/heirloom-mailx/files/patch-imap.c @@ -0,0 +1,30 @@ +--- imap.c.orig 2008-01-06 14:46:50.000000000 -0800 ++++ imap.c 2022-01-26 18:13:57.271602000 -0800 +@@ -3506,10 +3506,8 @@ + return -1; + if ((t = combinetime(year, month, day, 0, 0, 0)) == (time_t)-1) + return -1; +- tzdiff = t - mktime(gmtime(&t)); + tmptr = localtime(&t); +- if (tmptr->tm_isdst > 0) +- tzdiff += 3600; ++ tzdiff = tmptr->tm_gmtoff; /* seconds east of GMT */ + t -= tzdiff; + return t; + } +@@ -3521,13 +3519,11 @@ + struct tm *tmptr; + int tzdiff, tzdiff_hour, tzdiff_min; + +- tzdiff = t - mktime(gmtime(&t)); ++ tmptr = localtime(&t); ++ tzdiff = tmptr->tm_gmtoff; /* seconds east of GMT */ + tzdiff_hour = (int)(tzdiff / 60); + tzdiff_min = tzdiff_hour % 60; + tzdiff_hour /= 60; +- tmptr = localtime(&t); +- if (tmptr->tm_isdst > 0) +- tzdiff_hour++; + snprintf(s, sizeof s, "\"%02d-%s-%04d %02d:%02d:%02d %+03d%02d\"", + tmptr->tm_mday, + month_names[tmptr->tm_mon], diff --git a/mail/heirloom-mailx/files/patch-sendout.c b/mail/heirloom-mailx/files/patch-sendout.c index d95e185c4e3a..77aa7195e2b6 100644 --- a/mail/heirloom-mailx/files/patch-sendout.c +++ b/mail/heirloom-mailx/files/patch-sendout.c @@ -1,5 +1,5 @@ ---- sendout.c.orig 2022-01-26 14:24:22.000017000 -0800 -+++ sendout.c 2022-01-26 14:25:03.262517000 -0800 +--- sendout.c.orig 2008-07-03 23:09:57.000000000 -0700 ++++ sendout.c 2022-01-26 18:25:05.091791000 -0800 @@ -885,6 +885,7 @@ cp = expand(cp); else @@ -8,3 +8,30 @@ execv(cp, args); perror(cp); } +@@ -1123,9 +1124,7 @@ + + /* + * Create a Date: header field. +- * We compare the localtime() and gmtime() results to get the timezone, +- * because numeric timezones are easier to read and because $TZ is +- * not set on most GNU systems. ++ * We use tm->tm_gmtoff to account for negative DST adjustments (e.g. Ireland). + */ + int + mkdate(FILE *fo, const char *field) +@@ -1135,13 +1134,11 @@ + int tzdiff, tzdiff_hour, tzdiff_min; + + time(&t); +- tzdiff = t - mktime(gmtime(&t)); ++ tmptr = localtime(&t); ++ tzdiff = tmptr->tm_gmtoff; /* seconds east of GMT */ + tzdiff_hour = (int)(tzdiff / 60); + tzdiff_min = tzdiff_hour % 60; + tzdiff_hour /= 60; +- tmptr = localtime(&t); +- if (tmptr->tm_isdst > 0) +- tzdiff_hour++; + return fprintf(fo, "%s: %s, %02d %s %04d %02d:%02d:%02d %+05d\n", + field, + weekday_names[tmptr->tm_wday],