From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B09B9138359 for ; Sat, 10 Oct 2020 17:40:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 113FDE0817; Sat, 10 Oct 2020 17:40:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D98F4E0817 for ; Sat, 10 Oct 2020 17:40:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 77724335D8D for ; Sat, 10 Oct 2020 17:40:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 028B2332 for ; Sat, 10 Oct 2020 17:40:06 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1602351600.8cc44eb4b719129f109dfa623efd5420d1665b63.dilfridge@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch dev-qt/qtcore/qtcore-5.15.1-r1.ebuild X-VCS-Directories: dev-qt/qtcore/files/ dev-qt/qtcore/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 8cc44eb4b719129f109dfa623efd5420d1665b63 X-VCS-Branch: master Date: Sat, 10 Oct 2020 17:40:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bdf13081-b2fb-4fb4-b45a-b2d9e71e36ec X-Archives-Hash: fe0f18b7804754e97131077a4d7ebef4 commit: 8cc44eb4b719129f109dfa623efd5420d1665b63 Author: Andreas K. Hüttel gentoo org> AuthorDate: Sat Oct 10 17:39:33 2020 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sat Oct 10 17:40:00 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cc44eb4 dev-qt/qtcore: Revert timezone handling to 5.14 state This is an obvious workaround, until we and upstream have decided what to do... Closes: https://bugs.gentoo.org/737914 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Andreas K. Hüttel gentoo.org> dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch | 271 +++++++++++++++++++++ dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch | 47 ++++ dev-qt/qtcore/qtcore-5.15.1-r1.ebuild | 104 ++++++++ 3 files changed, 422 insertions(+) diff --git a/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch new file mode 100644 index 00000000000..1c8f1e89e7d --- /dev/null +++ b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch @@ -0,0 +1,271 @@ +From c337f6fae51b987ce7dbed1fd9bea41e6073efbb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= +Date: Sat, 10 Oct 2020 19:26:13 +0200 +Subject: [PATCH 1/2] Revert "Cache system zone ID when fetched from the + file-system" + +This reverts commit c70ce3d042025c858faffe661f85d2482a2a0d8c. +--- + src/corelib/time/qtimezoneprivate_tz.cpp | 205 +++++++---------------- + 1 file changed, 64 insertions(+), 141 deletions(-) + +diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp +index c5c70b7364..01f9a6cce0 100644 +--- a/src/corelib/time/qtimezoneprivate_tz.cpp ++++ b/src/corelib/time/qtimezoneprivate_tz.cpp +@@ -1,6 +1,5 @@ + /**************************************************************************** + ** +-** Copyright (C) 2020 The Qt Company Ltd. + ** Copyright (C) 2019 Crimson AS + ** Copyright (C) 2013 John Layt + ** Contact: https://www.qt.io/licensing/ +@@ -43,19 +42,18 @@ + #include "qtimezoneprivate_p.h" + #include "private/qlocale_tools_p.h" + +-#include +-#include + #include +-#include + #include ++#include ++#include ++#include + + #include +-#include + + #include + #include + #include +-#ifndef Q_OS_INTEGRITY ++#if !defined(Q_OS_INTEGRITY) + #include // to use MAXSYMLINKS constant + #endif + #include // to use _SC_SYMLOOP_MAX constant +@@ -1102,146 +1100,28 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecs + return last > tranCache().cbegin() ? dataForTzTransition(*--last) : invalidData(); + } + +-bool QTzTimeZonePrivate::isTimeZoneIdAvailable(const QByteArray &ianaId) const +-{ +- return tzZones->contains(ianaId); +-} +- +-QList QTzTimeZonePrivate::availableTimeZoneIds() const +-{ +- QList result = tzZones->keys(); +- std::sort(result.begin(), result.end()); +- return result; +-} +- +-QList QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const ++static long getSymloopMax() + { +- // TODO AnyCountry +- QList result; +- for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) { +- if (it.value().country == country) +- result << it.key(); +- } +- std::sort(result.begin(), result.end()); +- return result; +-} +- +-// Getting the system zone's ID: +- +-namespace { +-class ZoneNameReader : public QObject +-{ +-public: +- QByteArray name() +- { +- /* Assumptions: +- a) Systems don't change which of localtime and TZ they use without a +- reboot. +- b) When they change, they use atomic renames, hence a new device and +- inode for the new file. +- c) If we change which *name* is used for a zone, while referencing +- the same final zoneinfo file, we don't care about the change of +- name (e.g. if Europe/Oslo and Europe/Berlin are both symlinks to +- the same CET file, continuing to use the old name, after +- /etc/localtime changes which of the two it points to, is +- harmless). +- +- The alternative would be to use a file-system watcher, but they are a +- scarce resource. +- */ +- const StatIdent local = identify("/etc/localtime"); +- const StatIdent tz = identify("/etc/TZ"); +- if (!m_name.isEmpty() && m_last.isValid() && (m_last == local || m_last == tz)) +- return m_name; +- +- m_name = etcLocalTime(); +- if (!m_name.isEmpty()) { +- m_last = local; +- return m_name; +- } +- +- m_name = etcTZ(); +- m_last = m_name.isEmpty() ? StatIdent() : tz; +- return m_name; +- } +- +- +-private: +- QByteArray m_name; +- struct StatIdent +- { +- static constexpr unsigned long bad = ~0ul; +- unsigned long m_dev, m_ino; +- StatIdent() : m_dev(bad), m_ino(bad) {} +- StatIdent(const QT_STATBUF &data) : m_dev(data.st_dev), m_ino(data.st_ino) {} +- bool isValid() { return m_dev != bad || m_ino != bad; } +- bool operator==(const StatIdent &other) +- { return other.m_dev == m_dev && other.m_ino == m_ino; } +- }; +- StatIdent m_last; +- +- static StatIdent identify(const char *path) +- { +- QT_STATBUF data; +- return QT_STAT(path, &data) == -1 ? StatIdent() : StatIdent(data); +- } +- +- static QByteArray etcLocalTime() +- { +- // On most distros /etc/localtime is a symlink to a real file so extract +- // name from the path +- const QLatin1String zoneinfo("/zoneinfo/"); +- QString path = QStringLiteral("/etc/localtime"); +- long iteration = getSymloopMax(); +- // Symlink may point to another symlink etc. before being under zoneinfo/ +- // We stop on the first path under /zoneinfo/, even if it is itself a +- // symlink, like America/Montreal pointing to America/Toronto +- do { +- path = QFile::symLinkTarget(path); +- int index = path.indexOf(zoneinfo); +- if (index >= 0) // Found zoneinfo file; extract zone name from path: +- return path.midRef(index + zoneinfo.size()).toUtf8(); +- } while (!path.isEmpty() && --iteration > 0); +- +- return QByteArray(); +- } +- +- static QByteArray etcTZ() +- { +- // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ: +- const QString path = QStringLiteral("/etc/TZ"); +- QFile zone(path); +- if (zone.open(QIODevice::ReadOnly)) +- return zone.readAll().trimmed(); +- +- return QByteArray(); +- } +- +- // Any chain of symlinks longer than this is assumed to be a loop: +- static long getSymloopMax() +- { +-#ifdef SYMLOOP_MAX +- // If defined, at runtime it can only be greater than this, so this is a safe bet: +- return SYMLOOP_MAX; ++#if defined(SYMLOOP_MAX) ++ return SYMLOOP_MAX; // if defined, at runtime it can only be greater than this, so this is a safe bet + #else +- errno = 0; +- long result = sysconf(_SC_SYMLOOP_MAX); +- if (result >= 0) +- return result; +- // result is -1, meaning either error or no limit +- Q_ASSERT(!errno); // ... but it can't be an error, POSIX mandates _SC_SYMLOOP_MAX +- +- // therefore we can make up our own limit +-# ifdef MAXSYMLINKS +- return MAXSYMLINKS; ++ errno = 0; ++ long result = sysconf(_SC_SYMLOOP_MAX); ++ if (result >= 0) ++ return result; ++ // result is -1, meaning either error or no limit ++ Q_ASSERT(!errno); // ... but it can't be an error, POSIX mandates _SC_SYMLOOP_MAX ++ ++ // therefore we can make up our own limit ++# if defined(MAXSYMLINKS) ++ return MAXSYMLINKS; + # else +- return 8; ++ return 8; + # endif + #endif +- } +-}; + } + ++// TODO Could cache the value and monitor the required files for any changes + QByteArray QTzTimeZonePrivate::systemTimeZoneId() const + { + // Check TZ env var first, if not populated try find it +@@ -1256,9 +1136,28 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const + else if (ianaId.startsWith(':')) + ianaId = ianaId.mid(1); + ++ // On most distros /etc/localtime is a symlink to a real file so extract name from the path ++ if (ianaId.isEmpty()) { ++ const QLatin1String zoneinfo("/zoneinfo/"); ++ QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime")); ++ int index = -1; ++ long iteration = getSymloopMax(); ++ // Symlink may point to another symlink etc. before being under zoneinfo/ ++ // We stop on the first path under /zoneinfo/, even if it is itself a ++ // symlink, like America/Montreal pointing to America/Toronto ++ while (iteration-- > 0 && !path.isEmpty() && (index = path.indexOf(zoneinfo)) < 0) ++ path = QFile::symLinkTarget(path); ++ if (index >= 0) { ++ // /etc/localtime is a symlink to the current TZ file, so extract from path ++ ianaId = path.midRef(index + zoneinfo.size()).toUtf8(); ++ } ++ } ++ ++ // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ: + if (ianaId.isEmpty()) { +- thread_local static ZoneNameReader reader; +- ianaId = reader.name(); ++ QFile zone(QStringLiteral("/etc/TZ")); ++ if (zone.open(QIODevice::ReadOnly)) ++ ianaId = zone.readAll().trimmed(); + } + + // Give up for now and return UTC +@@ -1268,4 +1167,28 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const + return ianaId; + } + ++bool QTzTimeZonePrivate::isTimeZoneIdAvailable(const QByteArray &ianaId) const ++{ ++ return tzZones->contains(ianaId); ++} ++ ++QList QTzTimeZonePrivate::availableTimeZoneIds() const ++{ ++ QList result = tzZones->keys(); ++ std::sort(result.begin(), result.end()); ++ return result; ++} ++ ++QList QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const ++{ ++ // TODO AnyCountry ++ QList result; ++ for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) { ++ if (it.value().country == country) ++ result << it.key(); ++ } ++ std::sort(result.begin(), result.end()); ++ return result; ++} ++ + QT_END_NAMESPACE +-- +2.28.0 + diff --git a/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch new file mode 100644 index 00000000000..611c979a469 --- /dev/null +++ b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch @@ -0,0 +1,47 @@ +From ffc9093a199a542791920b30d1835c3248920aa0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= +Date: Sat, 10 Oct 2020 19:26:35 +0200 +Subject: [PATCH 2/2] Revert "Purge two old time-zone lookup fallbacks" + +This reverts commit b0383cbd388336f698ceeac11a4f50cdff931dd9. +--- + src/corelib/time/qtimezoneprivate_tz.cpp | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp +index 01f9a6cce0..eea6f5e962 100644 +--- a/src/corelib/time/qtimezoneprivate_tz.cpp ++++ b/src/corelib/time/qtimezoneprivate_tz.cpp +@@ -1153,6 +1153,29 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const + } + } + ++ // On Debian Etch up to Jessie, /etc/localtime is a copy of the relevant ++ // zoneinfo file, whose name is recorded in /etc/timezone: ++ if (ianaId.isEmpty()) { ++ QFile tzif(QStringLiteral("/etc/timezone")); ++ if (tzif.open(QIODevice::ReadOnly)) ++ ianaId = tzif.readAll().trimmed(); ++ } ++ ++ // On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock ++ // in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo" ++ if (ianaId.isEmpty()) { ++ QFile tzif(QStringLiteral("/etc/sysconfig/clock")); ++ if (tzif.open(QIODevice::ReadOnly)) { ++ while (ianaId.isEmpty() && !tzif.atEnd()) { ++ const QByteArray line(tzif.readLine().trimmed()); ++ if (line.startsWith("ZONE=")) ++ ianaId = line.mid(6, line.length() - 7); ++ else if (line.startsWith("TIMEZONE=")) ++ ianaId = line.mid(10, line.length() - 11); ++ } ++ } ++ } ++ + // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ: + if (ianaId.isEmpty()) { + QFile zone(QStringLiteral("/etc/TZ")); +-- +2.28.0 + diff --git a/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild new file mode 100644 index 00000000000..e5a80a34d43 --- /dev/null +++ b/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +QT5_MODULE="qtbase" +inherit linux-info qt5-build + +DESCRIPTION="Cross-platform application development framework" +SLOT=5/$(ver_cut 1-3) + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +IUSE="icu old-kernel systemd" + +DEPEND=" + dev-libs/double-conversion:= + dev-libs/glib:2 + dev-libs/libpcre2[pcre16,unicode] + sys-libs/zlib:= + icu? ( dev-libs/icu:= ) + !icu? ( virtual/libiconv ) + systemd? ( sys-apps/systemd:= ) +" +RDEPEND="${DEPEND} + !> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die + + #if defined(QT_NO_${flag}) && defined(QT_${flag}) + # undef QT_NO_${flag} + #elif !defined(QT_NO_${flag}) && !defined(QT_${flag}) + # define QT_NO_${flag} + #endif + _EOF_ + done +}