From 95079d2426403a1b7f6284816ebafa5cbe56dd720087f1b68a93411ae9e6ebac Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 8 Jul 2013 17:28:20 +0000 Subject: [PATCH] - restrict symlink change to systemd distros OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=112 --- timezone.changes | 5 +++++ timezone.spec | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/timezone.changes b/timezone.changes index 8423a80..b472b87 100644 --- a/timezone.changes +++ b/timezone.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 8 17:28:01 UTC 2013 - dmueller@suse.com + +- restrict symlink change to systemd distros + ------------------------------------------------------------------- Mon Jul 8 16:53:30 UTC 2013 - dmueller@suse.com diff --git a/timezone.spec b/timezone.spec index 6f08453..4792c43 100644 --- a/timezone.spec +++ b/timezone.spec @@ -92,7 +92,13 @@ if [ -f /etc/sysconfig/clock ]; then . /etc/sysconfig/clock if [ -n "$TIMEZONE" -a -f /etc/localtime -a -f /usr/share/zoneinfo/$TIMEZONE ]; then - ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime +%if 0%{?suse_version} >= 1230 + ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime +%else + new=$(mktemp /etc/localtime.XXXXXXXX) || exit 1 + cp -l /usr/share/zoneinfo/$TIMEZONE $new 2>/dev/null || cp -fp /usr/share/zoneinfo/$TIMEZONE $new + mv -f $new /etc/localtime +%endif else [ ! -f /etc/localtime ] || echo "WARNING: Not updating /etc/localtime with new zone file" >&2 fi