From b0383cbd388336f698ceeac11a4f50cdff931dd9 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 Apr 2020 15:01:06 +0200 Subject: 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 --- src/corelib/time/qtimezoneprivate_tz.cpp | 23 ----------------------- 1 file changed, 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")); -- cgit v1.2.3