[bitbake-devel] [PATCH 1/1] toaster: fix timezone detection
Alex DAMIAN
alexandru.damian at intel.com
Wed Mar 12 13:41:51 UTC 2014
From: Alexandru DAMIAN <alexandru.damian at intel.com>
This patch replaces faulty timezone detection with a version
that simply reads the TZ environment variable if it is set.
This has been tested with the list of TZ values from
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
[YOCTO #5499]
Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
bitbake/lib/toaster/toastermain/settings.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index 51fa3cc..8be1851 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -51,8 +51,10 @@ ALLOWED_HOSTS = []
# In a Windows environment this must be set to your system time zone.
# Always use local computer's time zone
-import time
-TIME_ZONE = time.tzname[0]
+TIME_ZONE = "posix/GMT-0" # have a sane default
+import os
+if 'TZ' in os.environ:
+ TIME_ZONE = os.environ['TZ']
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
--
1.8.3.2
More information about the bitbake-devel
mailing list