From e60fbc3aed6af876f343cff5fa211207ab8cb152 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 29 Oct 2014 11:37:19 -0400
Subject: [PATCH] Added mechanism for injecting extra shutdown cleanup action.

---
 build.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/build.xml b/build.xml
index 961ca4d41e3..f6d637a5fa4 100644
--- a/build.xml
+++ b/build.xml
@@ -7,6 +7,8 @@
   <property name="apacheconfdir" value="/etc/apache2/conf.d" />
   <property name="apachectl" value="false" /><!-- set to apachectl path to spin up Apache instance -->
   <property name="nodepath" value="" /><!-- set to node.js modules path to use Zombie.js testing -->
+  <!-- command for extra cleanup during shutdown; e.g. to change cache ownership after testing w/ Apache so deletion won't fail: -->
+  <property name="extra_shutdown_cleanup" value="false" />
   <property name="vufindurl" value="http://localhost/vufind" />
   <property name="vufinddb" value="vufind_test" />
   <property name="vufinddbuser" value="vufindtest" />
@@ -190,6 +192,14 @@
     <exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local JETTY_PID=${srcdir}/local/vufindtest.pid ${srcdir}/vufind.sh stop" outputProperty="LASTOUTPUT" />
     <echo message="${LASTOUTPUT}" />
 
+    <!-- run extra cleanup action, if any -->
+    <if>
+      <istrue value="${extra_shutdown_cleanup}" />
+      <then>
+        <exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local ${extra_shutdown_cleanup}" />
+      </then>
+    </if>
+
     <!-- delete the configuration, sample index, logs and cache data -->
     <delete dir="${srcdir}/solr/alphabetical_browse" includeemptydirs="true" failonerror="true" />
     <delete dir="${srcdir}/solr/authority/index" includeemptydirs="true" failonerror="true" />
-- 
GitLab