koha-shell assumes PERL5LIB is '/usr/share/koha', which if often incorrect in a git/dev install this patch attempts to fix this issue, by using the correct path
(In reply to Mason James from comment #0) > koha-shell assumes PERL5LIB is '/usr/share/koha', which if often incorrect > in a git/dev install > > this patch attempts to fix this issue, by using the correct path oops, which *is* often incorrect in a git/dev install
Created attachment 43446 [details] [review] Bug 13216 - fix koha shell to accept alternative perl5lib paths To test: gitify an install run sudo koha-shell instance run env | grep PERL5LIB it should be set to /usr/share/koha/lib run sudo koha-shell -d /path/to/your/git/install run env | grep PERL5LIB it should be set to /path/to/your/git/install
Created attachment 49578 [details] [review] Bug 13216 - fix koha shell to accept alternative perl5lib paths To test: gitify an install run sudo koha-shell instance run env | grep PERL5LIB it should be set to /usr/share/koha/lib run sudo koha-shell -d /path/to/your/git/install run env | grep PERL5LIB it should be set to /path/to/your/git/install Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
This is an interesting change. I added an see-also to a blocked bug 13971 from myself. I was not yet satisfied with the solution there. Instead of passing the kohadir on all individual scripts like koha-shell here, koha-rebuild-zebra or even another one in the other see-also, imo we would benefit from a more general approach. The get_perl5lib function in koha-functions.sh would do (from 13971); we should forget the other function is_gitified. Instead of passing the alternative path all the time, why not once record it in koha-conf.xml ? What do you think ?
For following through in QA, a reply would be welcome..
That's fine with me, I just wanted to avoid cruft in koha-conf. Liz
(In reply to Marcel de Rooy from comment #4) > This is an interesting change. > I added an see-also to a blocked bug 13971 from myself. I was not yet > satisfied with the solution there. > > Instead of passing the kohadir on all individual scripts like koha-shell > here, koha-rebuild-zebra or even another one in the other see-also, imo we > would benefit from a more general approach. > The get_perl5lib function in koha-functions.sh would do (from 13971); we > should forget the other function is_gitified. > > Instead of passing the alternative path all the time, why not once record it > in koha-conf.xml ? What do you think ? just my 2 cents... we need to know 2 things here... 1/ what the base directory of the Koha is? 2/ what kind of install type the Koha is? (eg: tar, git, .deb), as the directory structure is difference for each type we do need something like a is_gitified() function, that checks the koha-conf.xml file for some value knowing the base directory of the Koha, and 'guessing' the install type - wont give us enough info to sort this problem?
(In reply to Mason James from comment #7) > (In reply to Marcel de Rooy from comment #4) > > This is an interesting change. > > I added an see-also to a blocked bug 13971 from myself. I was not yet > > satisfied with the solution there. > > > > Instead of passing the kohadir on all individual scripts like koha-shell > > here, koha-rebuild-zebra or even another one in the other see-also, imo we > > would benefit from a more general approach. > > The get_perl5lib function in koha-functions.sh would do (from 13971); we > > should forget the other function is_gitified. > > > > Instead of passing the alternative path all the time, why not once record it > > in koha-conf.xml ? What do you think ? > > just my 2 cents... we need to know 2 things here... > > 1/ what the base directory of the Koha is? > 2/ what kind of install type the Koha is? (eg: tar, git, .deb), as the > directory structure is difference for each type > > we do need something like a is_gitified() function, that checks the > koha-conf.xml file for some value > > knowing the base directory of the Koha, and 'guessing' the install type - > wont give us enough info to sort this problem? specifically scripts like koha-update-schema and koha-translate will need to know these 2 things, to work correctly with a gitified Koha; as the dir structure is different for each type
I feel like that's a bit of scope creep - but I"m not opposed to adding something like a "check if gitified" function.
(In reply to Liz Rea from comment #9) > I feel like that's a bit of scope creep - but I"m not opposed to adding > something like a "check if gitified" function. yes, and yes ps: i'm not suggesting my recommendations need to happen before this bug should be accepted
Created attachment 50125 [details] [review] Bug 13216 - fix koha-shell to work with git/dev installs The aim of this patch is to enable developers to begin testing Koha tools from a gitified Koha directory, using koha-shell this patch adds a new --gitify arg to koha-shell, to be used with the new -d option to test new --gitify arg... 1/ apply 1st patch 2/ run a "koha-shell -c 'which koha-*'" on a Koha tool, with -d arg # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -c 'which koha-list ' moof /usr/sbin/koha-list <<<< 3/ observe existing /usr/share/koha/* file is selected, hmm... 4/ apply 2nd patch - and repeat 2/ with --gitify arg # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -g -c 'which koha-list ' moof ~/koha-master/debian/scripts/koha-list <<<< 5/ observe file from the git repo is now selected .-=bonus points, xXxtra merit=-. 6/ run tool to make sure it works # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -g -c 'koha-list' moof ... 7/ run the old tool too # perl ~/koha-master/debian/scripts/koha-shell -c 'koha-list' moof ...
Created attachment 50126 [details] [review] Bug 13216 - fix koha-shell to work with git/dev installs The aim of this patch is to enable developers to begin testing Koha tools from a gitified Koha directory, using koha-shell this patch adds a new --gitify arg to koha-shell, to be used with the new -d option to test new --gitify arg... 1/ apply 1st patch 2/ run a "koha-shell -c 'which koha-*'" on a Koha tool, with -d arg # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -c 'which koha-list ' moof /usr/sbin/koha-list <<<< 3/ observe existing /usr/share/koha/* file is selected, hmm... 4/ apply 2nd patch - and repeat 2/ with --gitify arg # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -g -c 'which koha-list ' moof ~/koha-master/debian/scripts/koha-list <<<< 5/ observe file from the git repo is now selected .-=bonus points, xXxtra merit=-. 6/ run tool to make sure it works # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -g -c 'koha-list' moof ... 7/ run the old tool too # perl ~/koha-master/debian/scripts/koha-shell -c 'koha-list' moof ...
Wouldn't it be nice if all the Debian special scripts worked regardless of type of install? I imagine there are a lot of hard-coded fields though, so that's probably a lot more work than one would imagine...
(In reply to Marcel de Rooy from comment #4) > This is an interesting change... >.. > Instead of passing the alternative path all the time, why not once record it > in koha-conf.xml ? What do you think ? Hi Marcel, I forgot to mention that I basically agree with your idea :) i think its possible to handle both options (koha.conf and shell), with a preference/override for the koha.conf values I would be happy to implement this, (perhaps in a separate bug?)
I would like to test this but the test plan is confusing to me. Could you revise it with some more specific instructions? For instance: run a "koha-shell -c 'which koha-*'" on a Koha tool, with -d arg The actual command would make a lot more sense to me.
(In reply to Owen Leonard from comment #15) > I would like to test this but the test plan is confusing to me. Could you > revise it with some more specific instructions? For instance: > > run a "koha-shell -c 'which koha-*'" on a Koha tool, with -d arg > > The actual command would make a lot more sense to me. I did provide an actual command - its the following line, after the line you quoted 2/ run a "koha-shell -c 'which koha-*'" on a Koha tool, with -d arg # perl ~/koha-master/debian/scripts/koha-shell -d ~/koha-master -c 'which koha-list ' moof
Created attachment 50202 [details] [review] Bug 13216 - fix koha-shell to work with git/dev installs The aim of this patch is to enable developers to begin testing Koha tools from a gitified Koha directory, using koha-shell this patch set adds a --gitify arg and a --kohadir arg to koha-shell To test: gitify an install apply both patches, then copy patched koha-shell to /usr/sbin dir run sudo koha-shell instance run env | grep PERL5LIB, it should be set to /usr/share/koha/lib run sudo koha-shell -d /path/to/your/git/install instance run env | grep PERL5LIB, it should be set to /path/to/your/git/install run which koha-list, it should be set to /usr/sbin/koha-list run sudo koha-shell -g -d /path/to/your/git/install instance run env | grep PERL5LIB, it should be set to /path/to/your/git/install run env | grep PATH, it should be set to /path/to/your/git/install/debian/scripts:$PATH run env | grep KOHA_GITIFY, it should be set to 1 run which koha-list, it should be set to /path/to/your/git/install/debian/scripts/koha-list run koha-list, it should work as expected run sudo koha-shell -g instance, it should give error... 'You must supply --kohadir when using --gitify' https://bugs.koha-community.org/show_bug.cgi?id=13295
Thank you very much for the clarified test plan. This looks like it's working. Once piece is missing: What should I be able to do with these patches that I couldn't do before?
Submitted some patches on bug 16733 to deal with the same issue in a broader perspective.