[f16-branch] Write human readable timezone information to /etc/timezone.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is to unify this basic config file with other distros. systemd is made to
maintain it in sync with /etc/localtime.

Resolves: rhbz#734626
---
 pyanaconda/timezone.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/timezone.py b/pyanaconda/timezone.py
index 405aa9b..8118090 100644
--- a/pyanaconda/timezone.py
+++ b/pyanaconda/timezone.py
@@ -33,8 +33,8 @@ class Timezone:
         f.write(" %s\n" % self.tz)
 
     def write(self, instPath):
+        # /etc/localtime
         fromFile = instPath + "/usr/share/zoneinfo/" + self.tz
-
         if not os.access(fromFile, os.R_OK):
             log.error("Timezone to be copied (%s) doesn't exist" % fromFile)
         else:
@@ -43,18 +43,22 @@ class Timezone:
             except EnvironmentError as e:
                 log.error("Error copying timezone (from %s): %s" % (fromFile, e.strerror))
 
+        # /etc/sysconfig/clock
         f = open(instPath + "/etc/sysconfig/clock", "w")
-
         f.write('ZONE="%s"\n' % self.tz)
         f.close()
 
+        # /etc/timezone (human readable timezone name)
+        with open(instPath + "/etc/timezone", 'w') as f:
+            f.write(self.tz)
+
+        # /etc/adjtime
         try:
             f = open(instPath + "/etc/adjtime", "r")
             lines = f.readlines()
             f.close()
         except:
             lines = [ "0.0 0 0.0\n", "0\n" ]
-
         f = open(instPath + "/etc/adjtime", "w")
         f.write(lines[0])
         f.write(lines[1])
-- 
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux