Bug 25586 - Something wrong with KOHA_HOME (?)
Summary: Something wrong with KOHA_HOME (?)
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-22 14:00 UTC by Jonathan Druart
Modified: 2020-06-09 01:16 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir (829 bytes, patch)
2020-06-04 13:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir (980 bytes, patch)
2020-06-05 09:44 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-05-22 14:00:53 UTC

    
Comment 1 Jonathan Druart 2020-05-22 14:01:23 UTC
debian/templates/koha-conf-site.xml.in: <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>

debian/koha-common.default:KOHA_HOME="/usr/share/koha"

debian/scripts/koha-functions.sh:        KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir)
Comment 2 Jonathan Druart 2020-06-04 13:35:36 UTC
KOHA_HOME can be:
 * /usr/share/koha  # pkg install
 * /kohadevbox/koha # dev install (or another path ofc, the one in the intranetdir config)


Weird thing:
 * debian/scripts/koha-plack

392             adjust_paths_dev_install $name
393             export DEV_INSTALL
394             export KOHA_HOME
395             PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer

On a pkg install we don't have /usr/share/koha/installer or /usr/share/koha/lib/installer
On a dev instal we don't have /kohadevbox/koha/lib
Comment 3 Jonathan Druart 2020-06-04 13:37:14 UTC
Created attachment 105552 [details] [review]
Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir
Comment 4 David Cook 2020-06-05 00:29:38 UTC
I was wondering what KOHA_HOME was about yesterday...

Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is unset.

Then in kohadevbox and koha-testing-docker, an environmental variable can be set to a dev install location?
Comment 5 Joonas Kylmälä 2020-06-05 09:44:29 UTC
Created attachment 105573 [details] [review]
Bug 25586: (bug 25618 follow-up) Use KOHA_HOME to guess pkg bin dir

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 6 Jonathan Druart 2020-06-05 09:45:14 UTC
(In reply to David Cook from comment #4)
> I was wondering what KOHA_HOME was about yesterday...
> 
> Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is
> unset.
> 
> Then in kohadevbox and koha-testing-docker, an environmental variable can be
> set to a dev install location?

We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think adding more variables will help.
Comment 7 Joonas Kylmälä 2020-06-05 09:56:27 UTC
KOHA_HOME is the place where intranetdir code is placed, I got this with grep:

> koha-functions.sh: KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir)

So using KOHA_HOME is favourable in my opinion to be able to support installations with different installation paths. The user should be able to change only the paths in koha-conf.xml and stuff should work, now without this variable things don't work so the original patch should be extended to include also koha-plack and maybe other scripts.
Comment 8 Marcel de Rooy 2020-06-05 09:58:56 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to David Cook from comment #4)
> > I was wondering what KOHA_HOME was about yesterday...
> > 
> > Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is
> > unset.
> > 
> > Then in kohadevbox and koha-testing-docker, an environmental variable can be
> > set to a dev install location?
> 
> We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think
> adding more variables will help.

This is not a new variable.
Comment 9 Jonathan Druart 2020-06-05 10:13:13 UTC
(In reply to Marcel de Rooy from comment #8)
> (In reply to Jonathan Druart from comment #6)
> > (In reply to David Cook from comment #4)
> > > I was wondering what KOHA_HOME was about yesterday...
> > > 
> > > Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is
> > > unset.
> > > 
> > > Then in kohadevbox and koha-testing-docker, an environmental variable can be
> > > set to a dev install location?
> > 
> > We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think
> > adding more variables will help.
> 
> This is not a new variable.

KOHA_HOME is not (hence this bug report). David's suggestion was to add a new one. At least it's what I understood.
Comment 10 David Cook 2020-06-09 01:16:54 UTC
(In reply to Jonathan Druart from comment #9)
> (In reply to Marcel de Rooy from comment #8)
> > (In reply to Jonathan Druart from comment #6)
> > > (In reply to David Cook from comment #4)
> > > > I was wondering what KOHA_HOME was about yesterday...
> > > > 
> > > > Maybe KOHA_HOME should be set to "/usr/share/koha" only if KOHA_HOME is
> > > > unset.
> > > > 
> > > > Then in kohadevbox and koha-testing-docker, an environmental variable can be
> > > > set to a dev install location?
> > > 
> > > We already have 'dev_install' and 'intranetdir' in koha-conf. I don't think
> > > adding more variables will help.
> > 
> > This is not a new variable.
> 
> KOHA_HOME is not (hence this bug report). David's suggestion was to add a
> new one. At least it's what I understood.

I think you misunderstood me, Jonathan. I meant keeping the existing KOHA_HOME variable, but setting it differently (to make it easier to re-configure for dev environments and when using systemd services).