[packages/tzdata] preserve as file on uninstall

glen glen at pld-linux.org
Mon May 30 18:46:26 CEST 2016


commit 8f291ac0db02c5a84382735652b4c873fcb0a467
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon May 30 19:46:19 2016 +0300

    preserve as file on uninstall

 tzdata.spec | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tzdata.git/commitdiff/8f291ac0db02c5a84382735652b4c873fcb0a467



More information about the pld-cvs-commit mailing list