SOURCES: gnome-panel-use-sysconfig-timezone.patch (NEW) - read inf...

megabajt megabajt at pld-linux.org
Sun Apr 27 00:03:10 CEST 2008


Author: megabajt                     Date: Sat Apr 26 22:03:10 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- read information about current timezone from /etc/sysconfig/timezone

---- Files affected:
SOURCES:
   gnome-panel-use-sysconfig-timezone.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gnome-panel-use-sysconfig-timezone.patch
diff -u /dev/null SOURCES/gnome-panel-use-sysconfig-timezone.patch:1.1
--- /dev/null	Sun Apr 27 00:03:10 2008
+++ SOURCES/gnome-panel-use-sysconfig-timezone.patch	Sun Apr 27 00:03:04 2008
@@ -0,0 +1,99 @@
+Index: applets/clock/system-timezone.c
+===================================================================
+--- applets/clock/system-timezone.c	(revision 11072)
++++ applets/clock/system-timezone.c	(working copy)
+@@ -67,23 +67,25 @@
+ #include "system-timezone.h"
+ 
+ /* Files that we look at and that should be monitored */
+-#define CHECK_NB 5
++#define CHECK_NB 6
+ #ifndef SYSTZ_SET_TEST
+-#define ETC_TIMEZONE        "/etc/timezone"
+-#define ETC_TIMEZONE_MAJ    "/etc/TIMEZONE"
+-#define ETC_RC_CONF         "/etc/rc.conf"
+-#define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock"
+-#define ETC_CONF_D_CLOCK    "/etc/conf.d/clock"
+-#define ETC_LOCALTIME       "/etc/localtime"
++#define ETC_TIMEZONE           "/etc/timezone"
++#define ETC_TIMEZONE_MAJ       "/etc/TIMEZONE"
++#define ETC_RC_CONF            "/etc/rc.conf"
++#define ETC_SYSCONFIG_CLOCK    "/etc/sysconfig/clock"
++#define ETC_SYSCONFIG_TIMEZONE "/etc/sysconfig/timezone"
++#define ETC_CONF_D_CLOCK       "/etc/conf.d/clock"
++#define ETC_LOCALTIME          "/etc/localtime"
+ #else
+ /* Filenames that will be writable for testing */
+-#define TEST_PREFIX         "/tmp/systz-test"
+-#define ETC_TIMEZONE        TEST_PREFIX"/etc/timezone"
+-#define ETC_TIMEZONE_MAJ    TEST_PREFIX"/etc/TIMEZONE"
+-#define ETC_RC_CONF         TEST_PREFIX"/etc/rc.conf"
+-#define ETC_SYSCONFIG_CLOCK TEST_PREFIX"/etc/sysconfig/clock"
+-#define ETC_CONF_D_CLOCK    TEST_PREFIX"/etc/conf.d/clock"
+-#define ETC_LOCALTIME       TEST_PREFIX"/etc/localtime"
++#define TEST_PREFIX            "/tmp/systz-test"
++#define ETC_TIMEZONE           TEST_PREFIX"/etc/timezone"
++#define ETC_TIMEZONE_MAJ       TEST_PREFIX"/etc/TIMEZONE"
++#define ETC_RC_CONF            TEST_PREFIX"/etc/rc.conf"
++#define ETC_SYSCONFIG_CLOCK    TEST_PREFIX"/etc/sysconfig/clock"
++#define ETC_SYSCONFIG_TIMEZONE TEST_PREFIX"/etc/sysconfig/timezone"
++#define ETC_CONF_D_CLOCK       TEST_PREFIX"/etc/conf.d/clock"
++#define ETC_LOCALTIME          TEST_PREFIX"/etc/localtime"
+ #endif /* SYSTZ_SET_TEST */
+ 
+ /* The first 4 characters in a timezone file, from tzfile.h */
+@@ -93,6 +95,7 @@
+         ETC_TIMEZONE,
+         ETC_TIMEZONE_MAJ,
+         ETC_SYSCONFIG_CLOCK,
++        ETC_SYSCONFIG_TIMEZONE,
+         ETC_CONF_D_CLOCK,
+         ETC_LOCALTIME
+ };
+@@ -312,6 +315,7 @@
+  *    openSUSE: the TIMEZONE key in /etc/sysconfig/clock
+  *    Solaris/OpenSolaris: the TZ key in /etc/TIMEZONE
+  *    Arch Linux: the TIMEZONE key in /etc/rc.conf
++ *    PLD Linux: the TIMEZONE key in /etc/sysconfig/timezone
+  *    Gentoo (old): the ZONE key in /etc/conf.d/clock
+  *
+  *    FIXME: reading the system-tools-backends, it seems there's this too:
+@@ -554,6 +558,22 @@
+                                                "ZONE", tz, error);
+ }
+ 
++/* This works for PLD Linux */
++static char *
++system_timezone_read_etc_sysconfig_timezone (void)
++{
++	return system_timezone_read_key_file (ETC_SYSCONFIG_TIMEZONE,
++					      "TIMEZONE");
++}
++
++static gboolean
++system_timezone_write_etc_sysconfig_timezone (const char  *tz,
++					      GError     **error)
++{
++	return system_timezone_write_key_file (ETC_SYSCONFIG_TIMEZONE,
++					       "TIMEZONE", tz, error);
++}
++
+ /* This works for openSUSE */
+ static char *
+ system_timezone_read_etc_sysconfig_clock_alt (void)
+@@ -812,6 +832,7 @@
+         system_timezone_read_etc_sysconfig_clock_alt,
+         system_timezone_read_etc_TIMEZONE,
+         system_timezone_read_etc_rc_conf,
++        system_timezone_read_etc_sysconfig_timezone,
+         /* reading deprecated config files */
+         system_timezone_read_etc_conf_d_clock,
+         /* reading /etc/timezone directly. Expensive since we have to stat
+@@ -983,6 +1004,7 @@
+         system_timezone_write_etc_sysconfig_clock_alt,
+         system_timezone_write_etc_TIMEZONE,
+         system_timezone_write_etc_rc_conf,
++        system_timezone_write_etc_sysconfig_timezone,
+         /* writing deprecated config files if they exist and have the
+          * setting already present */
+         system_timezone_write_etc_conf_d_clock,
================================================================


More information about the pld-cvs-commit mailing list