Do not override file pointed by /etc/localtime symlink

On Fedora 21 (and probably others) /etc/localtime is no longer file
copy, but a symlink to original timezone file. Using `cp` to change
timezone here would override original file instead of just changing the
timezone.

Details:
https://groups.google.com/d/msgid/qubes-users/4a0de9457e08b93d1a39ac4cdbc6b632%40ruggedinbox.com
This commit is contained in:
Marek Marczykowski-Górecki 2015-06-23 19:56:51 +02:00
parent 0382f84eae
commit 549761a144

View File

@ -88,7 +88,7 @@ fi
if ! grep -rq "^/etc/timezone$" "${PROTECTED_FILE_LIST}" 2>/dev/null; then
timezone=`$QDB_READ /qubes-timezone 2> /dev/null`
if [ -n "$timezone" ]; then
cp -p /usr/share/zoneinfo/$timezone /etc/localtime
ln -sf ../usr/share/zoneinfo/$timezone /etc/localtime
if [ -e /etc/debian_version ]; then
echo "$timezone" > /etc/timezone
else