From: Andreas Monzner Date: Mon, 20 Aug 2007 10:17:35 +0000 (+0000) Subject: set /etc/localtime link when change the timezone too X-Git-Tag: 2.6.0~1966 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/080c2a83b79af8afe48105bb0a1b69d3597a2e49?ds=sidebyside set /etc/localtime link when change the timezone too --- diff --git a/lib/python/Components/Timezones.py b/lib/python/Components/Timezones.py index 6e43aa21..d9edfec5 100644 --- a/lib/python/Components/Timezones.py +++ b/lib/python/Components/Timezones.py @@ -1,7 +1,7 @@ from xml.sax import make_parser from xml.sax.handler import ContentHandler -import os +from os import environ, unlink, symlink import time class Timezones: @@ -36,7 +36,12 @@ class Timezones: if len(self.timezones) <= index: return - os.environ['TZ'] = self.timezones[index][1] + environ['TZ'] = self.timezones[index][1] + try: + unlink("/etc/localtime") + except OSError: + pass + symlink("/usr/share/zoneinfo/%s" %(self.timezones[index][1]), "/etc/localtime") try: time.tzset() except: