]> git.pld-linux.org Git - packages/gnome-panel.git/blob - gnome-panel-use-sysconfig-timezone.patch
- merged from DEVEL
[packages/gnome-panel.git] / gnome-panel-use-sysconfig-timezone.patch
1 Index: applets/clock/system-timezone.c
2 ===================================================================
3 --- applets/clock/system-timezone.c     (revision 11072)
4 +++ applets/clock/system-timezone.c     (working copy)
5 @@ -67,13 +67,14 @@
6  #include "system-timezone.h"
7  
8  /* Files that we look at and that should be monitored */
9 -#define CHECK_NB 5
10 -#define ETC_TIMEZONE        "/etc/timezone"
11 -#define ETC_TIMEZONE_MAJ    "/etc/TIMEZONE"
12 -#define ETC_RC_CONF         "/etc/rc.conf"
13 -#define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
14 -#define ETC_CONF_D_CLOCK    "/etc/conf.d/clock"
15 -#define ETC_LOCALTIME       "/etc/localtime"
16 +#define CHECK_NB 6
17 +#define ETC_TIMEZONE           "/etc/timezone"
18 +#define ETC_TIMEZONE_MAJ       "/etc/TIMEZONE"
19 +#define ETC_RC_CONF            "/etc/rc.conf"
20 +#define ETC_SYSCONFIG_CLOCK    "/etc/sysconfig/clock"
21 +#define ETC_SYSCONFIG_TIMEZONE "/etc/sysconfig/timezone"
22 +#define ETC_CONF_D_CLOCK       "/etc/conf.d/clock"
23 +#define ETC_LOCALTIME          "/etc/localtime"
24  
25  /* The first 4 characters in a timezone file, from tzfile.h */
26  #define TZ_MAGIC "TZif"
27 @@ -93,6 +95,7 @@
28          ETC_TIMEZONE,
29          ETC_TIMEZONE_MAJ,
30          ETC_SYSCONFIG_CLOCK,
31 +        ETC_SYSCONFIG_TIMEZONE,
32          ETC_CONF_D_CLOCK,
33          ETC_LOCALTIME
34  };
35 @@ -312,6 +315,7 @@
36   *    openSUSE: the TIMEZONE key in /etc/sysconfig/clock
37   *    Solaris/OpenSolaris: the TZ key in /etc/TIMEZONE
38   *    Arch Linux: the TIMEZONE key in /etc/rc.conf
39 + *    PLD Linux: the TIMEZONE key in /etc/sysconfig/timezone
40   *    Gentoo (old): the ZONE key in /etc/conf.d/clock
41   *
42   *    FIXME: reading the system-tools-backends, it seems there's this too:
43 @@ -554,6 +558,22 @@
44                                                 "ZONE", tz, error);
45  }
46  
47 +/* This works for PLD Linux */
48 +static char *
49 +system_timezone_read_etc_sysconfig_timezone (void)
50 +{
51 +       return system_timezone_read_key_file (ETC_SYSCONFIG_TIMEZONE,
52 +                                             "TIMEZONE");
53 +}
54 +
55 +static gboolean
56 +system_timezone_write_etc_sysconfig_timezone (const char  *tz,
57 +                                             GError     **error)
58 +{
59 +       return system_timezone_write_key_file (ETC_SYSCONFIG_TIMEZONE,
60 +                                              "TIMEZONE", tz, error);
61 +}
62 +
63  /* This works for openSUSE */
64  static char *
65  system_timezone_read_etc_sysconfig_clock_alt (void)
66 @@ -812,6 +832,7 @@
67          system_timezone_read_etc_sysconfig_clock_alt,
68          system_timezone_read_etc_TIMEZONE,
69          system_timezone_read_etc_rc_conf,
70 +        system_timezone_read_etc_sysconfig_timezone,
71          /* reading deprecated config files */
72          system_timezone_read_etc_conf_d_clock,
73          /* reading /etc/timezone directly. Expensive since we have to stat
74 @@ -983,6 +1004,7 @@
75          system_timezone_write_etc_sysconfig_clock_alt,
76          system_timezone_write_etc_TIMEZONE,
77          system_timezone_write_etc_rc_conf,
78 +        system_timezone_write_etc_sysconfig_timezone,
79          /* writing deprecated config files if they exist and have the
80           * setting already present */
81          system_timezone_write_etc_conf_d_clock,
This page took 0.032074 seconds and 3 git commands to generate.