From 10972f677e3bd2ec69718c9ab579708ababdbbe7 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 18 Aug 2014 18:34:20 +0300 Subject: [PATCH] timezone-data: remove tzdata-setup script now, on tz change, xbmc saves the timezone directly into /storage/.cache/timezone in format: TIMEZONE=xx/yy defaults to UTC if not (yet) set (first boot) --- packages/sysutils/timezone-data/package.mk | 3 -- .../timezone-data/scripts/tzdata-setup | 41 ------------------- .../timezone-data/system.d/tz-data.service | 6 +-- 3 files changed, 3 insertions(+), 47 deletions(-) delete mode 100755 packages/sysutils/timezone-data/scripts/tzdata-setup diff --git a/packages/sysutils/timezone-data/package.mk b/packages/sysutils/timezone-data/package.mk index a729cd6fd0..981982a38c 100644 --- a/packages/sysutils/timezone-data/package.mk +++ b/packages/sysutils/timezone-data/package.mk @@ -50,9 +50,6 @@ post_makeinstall_target() { mkdir -p $INSTALL/etc ln -sf /var/run/localtime $INSTALL/etc/localtime - - mkdir -p $INSTALL/usr/lib/openelec - cp -PR $PKG_DIR/scripts/tzdata-setup $INSTALL/usr/lib/openelec } post_install() { diff --git a/packages/sysutils/timezone-data/scripts/tzdata-setup b/packages/sysutils/timezone-data/scripts/tzdata-setup deleted file mode 100755 index 140e9b4b9b..0000000000 --- a/packages/sysutils/timezone-data/scripts/tzdata-setup +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) -# -# OpenELEC is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# OpenELEC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenELEC. If not, see . -################################################################################ - - -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 - # 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.service b/packages/sysutils/timezone-data/system.d/tz-data.service index 6c756ea38c..96c660e0ac 100644 --- a/packages/sysutils/timezone-data/system.d/tz-data.service +++ b/packages/sysutils/timezone-data/system.d/tz-data.service @@ -2,11 +2,11 @@ Description=Setup Timezone data Before=xbmc.service -ConditionPathExists=/storage/.xbmc/userdata/guisettings.xml - [Service] Type=oneshot -ExecStart=/usr/lib/openelec/tzdata-setup +Environment=TIMEZONE=UTC +EnvironmentFile=-/storage/.cache/timezone +ExecStart=/bin/ln -sf /usr/share/zoneinfo/${TIMEZONE} /var/run/localtime RemainAfterExit=yes StartLimitInterval=0