From: Elan Ruusamäe Date: Mon, 30 May 2016 16:46:19 +0000 (+0300) Subject: preserve as file on uninstall X-Git-Tag: auto/ac/tzdata-2016f-1~1 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=8f291ac0db02c5a84382735652b4c873fcb0a467;p=packages%2Ftzdata.git preserve as file on uninstall --- diff --git a/tzdata.spec b/tzdata.spec index eabe5d4..e68737d 100644 --- a/tzdata.spec +++ b/tzdata.spec @@ -207,7 +207,10 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del timezone # save for postun - cp -af /etc/localtime /etc/localtime.rpmsave + localtime=$(readlink -f /etc/localtime) + # cp has no dereference target option, so remove link first + test -L /etc/localtime.rpmsave && rm -f /etc/localtime.rpmsave + cp -pf $localtime /etc/localtime.rpmsave fi %postun