[Koha-bugs] [Bug 31055] Move koha-functions to /usr/sbin instead of koha/bin

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 19 16:47:21 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31055

--- Comment #10 from wajasu <matted-34813 at mypacks.net> ---
if you colocate the koha-functions.sh next to the other scripts, you can source
them path relative. But if other scripts somewhere else them, they will use
have an absolute path.

Some lib or scripts directory is definitely desired with an absolute path.

Will they be used by maintenance scripts?  That you probably don't want in
/usr/sbin.
I didn't find any currently when grepping. Most of our scripts are perl, but
these are bash shell.

A) /usr/share/koha/lib           <-- perl code
B) /usr/share/koha/lib/scripts   <-- doesn't exist yet
C) /usr/sbin                     <-- but gets out commands available in system
dir
D) /usr/share/koha/bin           <-- This is where koha-functions.sh is now.
                                  (which not on the PATH in KTD.  by design?)

I can easily test many of the koha-functions by sourcing the file from
debian/scripts and just calling them in the shell to examine $? and such.

Then I just run the cp_debian_files.pl everytime I make change.  Because the
koha-commands are sourcing the absolute path anyway.  A pain to fix/test, but
it works.

I tried to add a PREPATH inthe files/templates/defaults.env and change it in my
.env, but alas run.sh is set in stone in the image.  Making it less easy to
change (accidentall).
I was trying to put /kohadevbox/koha/debian/scripts prepended to the PATH so I
could edit/test without cp_debian_files.pl but that would only work if run.sh
had PATH=${PREPATH}:/usr/bin/usr/sbin/${PATH}:/kohadevbox/bin  and the koha-*
scripts used source ./koha-functions.sh

Maybe making it less painful to test with koha_functions.sh in the same
directory as /usr/sbin  is less clunky to fix/test and even explain an easier
test plan (without cp_debian_files.pl).

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list