Remove already present XSL files from /etc/pazpar2
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 6 May 2014 11:54:03 +0000 (13:54 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 6 May 2014 11:54:03 +0000 (13:54 +0200)
If files are identical they can be safely removed because
the new version is in /usr/share/pazpar2/xsl

debian/pazpar2.postinst
pazpar2.spec

index 7bf566b..c5862f4 100644 (file)
@@ -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
index 93f3fe5..5bf759e 100644 (file)
@@ -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