From 8cffdac106e6e103aeda6a21d48b328c46c58418 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 6 May 2014 13:54:03 +0200 Subject: [PATCH] Remove already present XSL files from /etc/pazpar2 If files are identical they can be safely removed because the new version is in /usr/share/pazpar2/xsl --- debian/pazpar2.postinst | 8 ++++++++ pazpar2.spec | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/debian/pazpar2.postinst b/debian/pazpar2.postinst index 7bf566b..c5862f4 100644 --- a/debian/pazpar2.postinst +++ b/debian/pazpar2.postinst @@ -9,6 +9,14 @@ no_services=true for f in /etc/pazpar2/services-enabled/*.xml; do test -e $f && no_services=false done +for f in /usr/share/pazpar2/xsl/*.xsl; do + e=/etc/pazpar2/`basename $f` + if test -f $e; then + if diff $e $f >/dev/null; then + rm $e + fi + fi +done if ${no_services}; then ln -sf ../services-available/default.xml \ /etc/pazpar2/services-enabled/default.xml diff --git a/pazpar2.spec b/pazpar2.spec index 93f3fe5..5bf759e 100644 --- a/pazpar2.spec +++ b/pazpar2.spec @@ -26,6 +26,14 @@ Group: Data Requires: pazpar2 %post +for f in /usr/share/pazpar2/xsl/*.xsl; do + e=/etc/pazpar2/`basename $f` + if test -f $e; then + if diff $e $f >/dev/null; then + rm $e + fi + fi +done if [ $1 = 1 ]; then /sbin/chkconfig --add pazpar2 /sbin/service pazpar2 start > /dev/null 2>&1 -- 1.7.10.4