From d440e3f936b5365d19ee048ca18a387c39abe141 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 8 Apr 2015 16:28:18 +0200 Subject: [PATCH] Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance Content-Type: text/plain; charset=utf-8 This patch adds a few lines to koha-rebuild-zebra in order to adjust the locations for PERL5LIB and rebuild_zebra.pl script. It builds on the notion that /etc/koha/sites/[instance] contains a file called gitified containing the path to the gitified instance (instead of the default /usr/share/koha or other installed default). NOTE: As long as the gitified file does not exist, behavior does not change. I will submit a separate follow-up report for creating the gitified file. Furthermore, I would like to use the Zebra setup from the gitified instance instead of the default files in /etc/koha/zebradb. Will put that in another report too. Test plan: [1] Do not have a file /etc/koha/sites/[instance]/gitified. [2] Run koha-rebuild-zebra -a -b -v [instance] [3] If you have a gitified Koha instance, put the path in that etc file. [4] Run koha-rebuild-zebra -a -b -v [instance] --- debian/scripts/koha-rebuild-zebra | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/scripts/koha-rebuild-zebra b/debian/scripts/koha-rebuild-zebra index f8267c5..d947879 100755 --- a/debian/scripts/koha-rebuild-zebra +++ b/debian/scripts/koha-rebuild-zebra @@ -49,12 +49,21 @@ run_rebuild_zebra() { local instancename=$1; shift + # If we 'gitified' a Koha instance, point to adjusted locations + if [ -e /etc/koha/sites/$instancename/gitified ]; then + libpath=`cat /etc/koha/sites/$instancename/gitified` + rebuild=$libpath/misc + else + libpath=/usr/share/koha/lib + rebuild=/usr/share/koha/bin + fi + # TODO: This comment is here to remind us that we should make # rebuild_zebra.pl return error codes on failure if sudo -u "$instancename-koha" -H \ - env PERL5LIB=/usr/share/koha/lib \ + env PERL5LIB=$libpath \ KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \ - /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then + $rebuild/migration_tools/rebuild_zebra.pl $@ ; then return 0 else return 1 -- 1.7.10.4