diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-04-06 15:01:06 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-04-07 05:10:14 +0200 |
commit | b0383cbd388336f698ceeac11a4f50cdff931dd9 (patch) | |
tree | dfef69b4b38ca1b3c6e9fc248e8224f8682187c6 | |
parent | b40ac4b858958db136c0e39dc074c74429b568e9 (diff) |
Purge two old time-zone lookup fallbacks
We used to need to consult /etc/timezone for the zone name back when
Debian, up to Jessie, used a copy of the zoneinfo file as
/etc/localtime, instead of a symlink. Jessie's end of life is this
May, but Thiago reports that its gcc can't build Qt 5.14, so we may as
well remove this fall-back. Newer versions of Debian use a symlink.
We used to need to consult /etc/sysconfig/clock for this information
back when ancient Red Hat distros copied zoneinfo to /etc/localtime
instead of symlinking, but Thiago believes that's now ancient history.
So, again, remove this old fallback.
Change-Id: I73cb40b926186b311dac6f00fe8743d37a9dfce5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/time/qtimezoneprivate_tz.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp index 1d1b5b05cb..ada19f4eb4 100644 --- a/src/corelib/time/qtimezoneprivate_tz.cpp +++ b/src/corelib/time/qtimezoneprivate_tz.cpp @@ -1153,29 +1153,6 @@ 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")); |