diff --git a/packages/mediacenter/xbmc/patches/xbmc-995.12-run-tzdata-setup-on-timezone-change.patch b/packages/mediacenter/xbmc/patches/xbmc-995.12-run-tzdata-setup-on-timezone-change.patch new file mode 100644 index 0000000000..51a7e52381 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-995.12-run-tzdata-setup-on-timezone-change.patch @@ -0,0 +1,26 @@ +From 25be1b385303a8114d7e227ffab52a22de42ccd1 Mon Sep 17 00:00:00 2001 +From: Stefan Saraev +Date: Tue, 26 Nov 2013 20:53:08 +0200 +Subject: [PATCH] run tzdata-setup on timezone change + +--- + xbmc/linux/LinuxTimezone.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp +index be7bce6..4000181 100644 +--- a/xbmc/linux/LinuxTimezone.cpp ++++ b/xbmc/linux/LinuxTimezone.cpp +@@ -158,6 +158,9 @@ void CLinuxTimezone::OnSettingChanged(const CSetting *setting) + const std::string &settingId = setting->GetId(); + if (settingId == "locale.timezone") + { ++ const std::string cmd = std::string("sh /usr/lib/openelec/tzdata-setup ") + ((CSettingString*)setting)->GetValue().c_str(); ++ system(cmd.c_str()); ++ + SetTimezone(((CSettingString*)setting)->GetValue()); + + CDateTime::ResetTimezoneBias(); +-- +1.8.3.2 + diff --git a/packages/sysutils/timezone-data/package.mk b/packages/sysutils/timezone-data/package.mk index 4015c2e7e9..c839689deb 100644 --- a/packages/sysutils/timezone-data/package.mk +++ b/packages/sysutils/timezone-data/package.mk @@ -59,6 +59,5 @@ post_makeinstall_target() { } post_install() { - enable_service tz-data-monitor.path enable_service tz-data.service } diff --git a/packages/sysutils/timezone-data/scripts/tzdata-setup b/packages/sysutils/timezone-data/scripts/tzdata-setup index 67484dad57..5790e2183b 100755 --- a/packages/sysutils/timezone-data/scripts/tzdata-setup +++ b/packages/sysutils/timezone-data/scripts/tzdata-setup @@ -19,14 +19,25 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -GUISETTINGS="/storage/.xbmc/userdata/guisettings.xml" -if [ -f "$GUISETTINGS" ] ; then - TIMEZONE=`sed -n -e 's/.*\(.*\)<\/timezone>.*/\1/p' /storage/.xbmc/userdata/guisettings.xml` -fi - -if [ ! "$TIMEZONE" == "" -a -f "/usr/share/zoneinfo/$TIMEZONE" ] ; then - ln -sf "/usr/share/zoneinfo/$TIMEZONE" /var/run/localtime +if [ -z "$1" ] ; then + # called from systemd. read timezone if set + if [ -f /storage/.cache/timezone ] ; then + TIMEZONE=`cat /storage/.cache/timezone` + else + if [ -f /storage/.xbmc/userdata/guisettings.xml ] ; then + TIMEZONE=`sed -n -e 's/.*\(.*\)<\/timezone>.*/\1/p' /storage/.xbmc/userdata/guisettings.xml` + fi + if [ -z "TIMEZONE" ] ; then + TIMEZONE="UTC" + fi + # save it! + echo "$TIMEZONE" > /storage/.cache/timezone + fi else - ln -sf "/usr/share/zoneinfo/UTC" /var/run/localtime + # called from xbmc. save the timezone! + TIMEZONE="$1" + echo "$TIMEZONE" > /storage/.cache/timezone fi + +ln -sf "/usr/share/zoneinfo/$TIMEZONE" /var/run/localtime diff --git a/packages/sysutils/timezone-data/system.d/tz-data-monitor.path b/packages/sysutils/timezone-data/system.d/tz-data-monitor.path deleted file mode 100644 index b48489702d..0000000000 --- a/packages/sysutils/timezone-data/system.d/tz-data-monitor.path +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Timezone data monitor -After=local-fs.target - -[Path] -PathChanged=/storage/.xbmc/userdata/guisettings.xml - -[Install] -WantedBy=multi-user.target diff --git a/packages/sysutils/timezone-data/system.d/tz-data-monitor.service b/packages/sysutils/timezone-data/system.d/tz-data-monitor.service deleted file mode 100644 index efd5ffc003..0000000000 --- a/packages/sysutils/timezone-data/system.d/tz-data-monitor.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Timezone data monitor - -[Service] -Type=oneshot -ExecStart=/bin/systemctl restart tz-data.service -StartLimitInterval=0 - -[Install] -WantedBy=multi-user.target