summaryrefslogtreecommitdiffstats
path: root/source/l/glib2/glib2.slackware.localtime.diff
blob: 1170e140223636da33ccbd7ae608cb8c044bf73c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 05690c6bdb6751278352fefe96061395de490663 Mon Sep 17 00:00:00 2001

From: Patrick J. Volkerding <volkerdi@slackware.com>
Date: Mon, 19 Oct 2020 12:54:57 -0600
Subject: [PATCH] Also look at /etc/localtime-copied-from

In Slackware, /etc/localtime is a copy of the local timezone file, not a
symlink to it, but the latest glib expects a symlink (because that's been
demanded by systemd and guess-who). So, if we find that /etc/localtime is
not a symlink, consider /etc/localtime-copied-from next. On Slackware
systems this will be a symlink to the local timezone file under
/usr/share/zoneinfo. We still want to consider the possibility that
/etc/localtime *is* a symlink first though, since that's an acceptable
local system modification on Slackware.

--- ./glib/gtimezone.c.orig	2020-10-19 10:05:31.300005400 -0500
+++ ./glib/gtimezone.c	2020-10-19 13:04:58.796033505 -0500
@@ -451,6 +451,17 @@
 
   /* Resolve the actual timezone pointed to by /etc/localtime. */
   resolved_identifier = g_file_read_link ("/etc/localtime", &read_link_err);
+
+  /* If we didn't get the timezone here (probably because
+   * /etc/localtime is not a symlink), then we will try again using
+   * /etc/localtime-copied-from, which on Slackware is a symlink to
+   * the local timezone file. */
+  if (resolved_identifier == NULL)
+    {
+      g_clear_error (&read_link_err);
+      resolved_identifier = g_file_read_link ("/etc/localtime-copied-from", &read_link_err);
+    }
+
   if (resolved_identifier == NULL)
     {
       gboolean not_a_symlink = g_error_matches (read_link_err,