From f6d83149036c800310fb307b79a477c614141056 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 8 Feb 2015 21:33:24 +0000 Subject: drakclock: Ensure that /etc/localtime is a symlink (mga#14888) This is actually just a followup to d4be53b62 to use the wrapper symlinkf() function which seems a little bit neater (subjective) and to update NEWS file. --- perl-install/NEWS | 1 + perl-install/timezone.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 9b39624b6..bafa1b15a 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,4 @@ +- drakclock: Ensure that /etc/localtime is a symlink (mga#14888) - users: Make sure to restart accounts-daemon after adding users (mga#15113, mga#14476) - i18n: Write the desired console font to /etc/vconsole.conf - i18n: Use the x-distro /etc/locale.conf file instead of /etc/sysconfig/i18n diff --git a/perl-install/timezone.pm b/perl-install/timezone.pm index 98a33c368..ec252c603 100644 --- a/perl-install/timezone.pm +++ b/perl-install/timezone.pm @@ -64,8 +64,8 @@ sub write { set_ntp_server($t->{ntp}); my $tz_prefix = get_timezone_prefix(); - unlink "$::prefix/etc/localtime" or log::l("unlinking $! failed"); - symlink ($tz_prefix . '/' . $t->{timezone}, "$::prefix/etc/localtime") or log::l("linking /etc/localtime failed"); + eval { symlinkf($tz_prefix . '/' . $t->{timezone}, "$::prefix/etc/localtime") }; + $@ and log::l("installing /etc/localtime failed"); setVarsInSh("$::prefix/etc/sysconfig/clock", { ZONE => $t->{timezone}, UTC => bool2text($t->{UTC}), -- cgit v1.2.1