Summary: | Adjusted locations in koha-rebuild-zebra for gitified instance | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Packaging | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | chrish, jonathan.druart, mirko, robin |
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13216 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: |
Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance
Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance |
Description
Marcel de Rooy
2015-04-08 14:27:52 UTC
Created attachment 37582 [details] [review] Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance 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] Would be interested in feedback on this idea (including the mentioned follow-ups in the commit message) from Robin for packages or Chris for gitify! Note that I am just exploring Debian now finally :) So, Liz and I were chatting about this just yesterday. What I was thinking was having a library file/function that all the scripts run that exports PERL5LIB into the environment, taking it from, perhaps, koha-conf.xml. Currently koha-conf.xml doesn't really have a facility for a path for this, but adding one wouldn't be a big deal. On the other hand, I like better your more general (and easier to work with programmatically) method of having a file, though I'd be not inclined to call it 'gitify' just because it's useful in other situations too, I'm sure (though I don't know what :) So yeah, like the plan and the approach, just think it should be generalised a bit more using the library stuff we have so it works for other scripts too (_especially_ koha-upgrade-schema.) Created attachment 37616 [details] [review] Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance This patch adds a few lines to koha-rebuild-zebra in order to adjust the locations for PERL5LIB and rebuild_zebra.pl script. It also adds two functions to koha-functions: is_gitified and get_perl5lib. It builds on the notion that koha-conf.xml contains a <gitified> tag for gitified installs. It also looks for a perl5lib tag in koha-conf. NOTE: If the gitified or the perl5lib tag does not exist, behavior does not change. I will submit a separate follow-up report for adding those tags. The use of function get_perl5lib can replace hardcoded paths in the other scripts too; I will also move that to a new report. 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] Verify that your koha-conf does not contain: <gitified>1</gitified> [2] Run koha-rebuild-zebra -a -b -v [instance] [3] If you have a gitified instance, add the gitified tag to your koha-conf and the path in a perl5lib tag. [4] Run koha-rebuild-zebra -a -b -v [instance] Verify that you run the right version of rebuild_zebra.pl. You could do that by adding a simple debug print. (In reply to Robin Sheat from comment #3) > So, Liz and I were chatting about this just yesterday. What I was thinking > was having a library file/function that all the scripts run that exports > PERL5LIB into the environment, taking it from, perhaps, koha-conf.xml. > > Currently koha-conf.xml doesn't really have a facility for a path for this, > but adding one wouldn't be a big deal. > > On the other hand, I like better your more general (and easier to work with > programmatically) method of having a file, though I'd be not inclined to > call it 'gitify' just because it's useful in other situations too, I'm sure > (though I don't know what :) > > So yeah, like the plan and the approach, just think it should be generalised > a bit more using the library stuff we have so it works for other scripts too > (_especially_ koha-upgrade-schema.) Thanks. Submitted an adjusted patch for those two actually separate things: 1) get a path from koha-conf with get_perl5lib 2) get gitified status from koha-conf too with is_gitified (no longer a file) So two new functions in koha-functions. Please look too at the scriptdir lines in koha-rebuild-zebra at the start. Created attachment 40628 [details] [review] Bug 13971: Adjusted locations in koha-rebuild-zebra for gitified instance This patch adds a few lines to koha-rebuild-zebra in order to adjust the locations for PERL5LIB and rebuild_zebra.pl script. It also adds two functions to koha-functions: is_gitified and get_perl5lib. It builds on the notion that koha-conf.xml contains a <gitified> tag for gitified installs. It also looks for a perl5lib tag in koha-conf. NOTE: If the gitified or the perl5lib tag does not exist, behavior does not change. I will submit a separate follow-up report for adding those tags. The use of function get_perl5lib can replace hardcoded paths in the other scripts too; I will also move that to a new report. 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] Verify that your koha-conf does not contain: <gitified>1</gitified> [2] Run koha-rebuild-zebra -a -b -v [instance] [3] If you have a gitified instance, add the gitified tag to your koha-conf and the path in a perl5lib tag. [4] Run koha-rebuild-zebra -a -b -v [instance] Verify that you run the right version of rebuild_zebra.pl. You could do that by adding a simple debug print. Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Looks good to me. I would like to get a signoff from Robin or Chris Hall to be more comfortable before passing QA on it. Is there an easy way to know if an instance has been gitified? It will avoid to manually add a new entry to the koha-conf file. Moving this one to BLOCKED May come up with a slightly adjusted approach.. |