diff options
Diffstat (limited to 'devel/qt5-core')
-rw-r--r-- | devel/qt5-core/Makefile | 1 | ||||
-rw-r--r-- | devel/qt5-core/files/patch-src_corelib_time_qtimezoneprivate__tz.cpp | 45 |
2 files changed, 28 insertions, 18 deletions
diff --git a/devel/qt5-core/Makefile b/devel/qt5-core/Makefile index 75145e901207..ddbdc6603127 100644 --- a/devel/qt5-core/Makefile +++ b/devel/qt5-core/Makefile @@ -2,7 +2,6 @@ PORTNAME= core DISTVERSION= ${QT5_VERSION} -PORTREVISION= 4 CATEGORIES= devel PKGNAMEPREFIX= qt5- diff --git a/devel/qt5-core/files/patch-src_corelib_time_qtimezoneprivate__tz.cpp b/devel/qt5-core/files/patch-src_corelib_time_qtimezoneprivate__tz.cpp index 2402e0c7cb31..24cfeb9f9a53 100644 --- a/devel/qt5-core/files/patch-src_corelib_time_qtimezoneprivate__tz.cpp +++ b/devel/qt5-core/files/patch-src_corelib_time_qtimezoneprivate__tz.cpp @@ -1,28 +1,39 @@ ---- src/corelib/time/qtimezoneprivate_tz.cpp.orig 2020-05-11 08:15:08 UTC +--- src/corelib/time/qtimezoneprivate_tz.cpp.orig 2020-09-12 18:44:11 UTC +++ src/corelib/time/qtimezoneprivate_tz.cpp -@@ -1153,6 +1153,25 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() cons - } - } +@@ -1155,6 +1155,8 @@ class ZoneNameReader : public QObject (public) + return m_name; + + m_name = etcLocalTime(); ++ if (m_name.isEmpty()) ++ m_name = varDBZoneinfo(); + if (!m_name.isEmpty()) { + m_last = local; + return m_name; +@@ -1203,6 +1205,27 @@ class ZoneNameReader : public QObject (public) + return path.midRef(index + zoneinfo.size()).toUtf8(); + } while (!path.isEmpty() && --iteration > 0); -+ // On some FreeBSD systems, /etc/localtime is a regular file while -+ // the actual name is in /var/db/zoneinfo -+ if (ianaId.isEmpty()) { ++ return QByteArray(); ++ } ++ ++ static QByteArray varDBZoneinfo() ++ { ++ // On some FreeBSD systems, /etc/localtime is a regular file while ++ // the actual name is in /var/db/zoneinfo + QFile tzif(QStringLiteral("/var/db/zoneinfo")); + if (tzif.open(QIODevice::ReadOnly)) { + const int maximumTZNameLength = 256; + QByteArray tzcontents( tzif.read( maximumTZNameLength ) ); + if (tzcontents.size() >= 2) { -+ // Shortest TZ would be UTC, or r/z, but there's special -+ // cases "GB" and "US" + const int newlineIndex = tzcontents.indexOf('\n'); + if (newlineIndex < 0) // No newline in file -+ ianaId = tzcontents; -+ if (newlineIndex > 2) // Newline, chop it off -+ ianaId = tzcontents.left(newlineIndex); ++ return tzcontents; ++ // Shortest TZ name in FreeBSD is "GB", "NZ" or "US" ++ if (newlineIndex >= 2) // Newline, chop it off ++ return tzcontents.left(newlineIndex); ++ // Newline on position 0 or 1 is an invalid name + } + } -+ } -+ - // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ: - if (ianaId.isEmpty()) { - QFile zone(QStringLiteral("/etc/TZ")); + return QByteArray(); + } + |