From nobody Thu Jan 27 02:37:29 2022 X-Original-To: dev-commits-ports-all@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 5FA7E1980C44; Thu, 27 Jan 2022 02:37:30 +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 4Jkl9k1ffLz4Ws3; Thu, 27 Jan 2022 02:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643251050; 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=WwCqgHFvBh9Fg+wNaYmJ2fwva2HV/+O0HNI5aMo7YLc=; b=DL7Nzonv1ymz3yiAr5qHvYXbKdIwlcKDdLkl/+U3aCl0hDfXmqaaor48FEDcow2qbKsmds I7eVo3viIjyBKLTbkX8kmZbNQlFwbvVS+nURnEOPCjzHRlN/IaPh1Owz9wFh03gZRR7cse Ma5aNWVoDLOheBlF8qNXcnt7KQqi+QDsudD+auv0d2YDBFhzWpbXbWNEDF2L9xha459oME nPrKwcWldQq9cL1ECQV7oBX6B0f//uASQxYnN8K6VDM0IM6UW+pJP57F/FgH7twhTTlEep FyLDfMIPk1DS6DXXXjRvCEJFFkxq0xWD48X5NQTOSHSZitZ7keQIzDUbLrp2Pg== 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 14D806610; Thu, 27 Jan 2022 02:37:30 +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 20R2bTF2089056; Thu, 27 Jan 2022 02:37:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20R2bTn5089055; Thu, 27 Jan 2022 02:37:29 GMT (envelope-from git) Date: Thu, 27 Jan 2022 02:37:29 GMT Message-Id: <202201270237.20R2bTn5089055@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: c4f80928aed6 - main - mail/heirloom-mailx: Fix wrong UTC offset for Europe/Dublin List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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/main X-Git-Reftype: branch X-Git-Commit: c4f80928aed6891068ad6cf9be8c4aaff2a62e24 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643251050; 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=WwCqgHFvBh9Fg+wNaYmJ2fwva2HV/+O0HNI5aMo7YLc=; b=q6jOzpPd/Jpd7NHf1GPfCmJzJAdgFhsrfbTOh129l7xxamCJ8WlPJZ0Jji8Blsc2QrLlnh UySuitrFztjpqZ3SSadLYMrEJGF+KhM+3kBjDY2drxyHqPIOzwGcYPhbLyULE3huMXoVAl q5LKj59UjVbsIvyQytKPuRxgnfzTkTco3VJfcQ9R7wVozMKmcRvSID0Kmus4yRk9YqXxUu 0Uk6Gcivdc6jMDU808P2b9o3dAGfNfryUPxYKgRaJkuJ6YWOYlCupIKKiTbXAWe7Lf1NdP K5tfB4wn3vSOpq86MvB68pbzp87ViWtyrPVufOL6T87E06Xdu9OkX9cTwnT0Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643251050; a=rsa-sha256; cv=none; b=KL+RTVv0VoxITRLY452esoV+WZO+Uru75Mpl8PLnqMNMkVPvVFEeFmowkzCytc4heDDQmk g1mG9udD41zqqG3HwsWdQraVXekjepF1x8mmfhtUHFvYTMYSFPCTF5/qcimd01KWUjgOVD 03yFaFfr6DWFh2RtNzTiXRNl2WirufT48Pg36odEYXWRhMoUQdGVAahlHgXH7dgOB89xuF LTIhnZO8BV4caR96WaOQF855O0LZ25ttK8oXE/MPzHXDKhGfHqAP/SlzEXT3GUlpc+vwSP yAdRubLmn/6ZBlcOSIzdwpTxcd1PmHKzDsvRQ+3EHbY2rO+Y5fg3QTennNx1Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=c4f80928aed6891068ad6cf9be8c4aaff2a62e24 commit c4f80928aed6891068ad6cf9be8c4aaff2a62e24 Author: Andrea Biardi AuthorDate: 2022-01-27 02:29:51 +0000 Commit: Cy Schubert CommitDate: 2022-01-27 02:36:59 +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 --- 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],