Summary: | misc/kohalib.pl no longer useful | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, gmc, gmcharlt, kyle, m.de.rooy, martin.renvoize, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28519 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This enhancement removes the script misc/kohalib.pl.
The purpose of this script was to load the relevant Koha lib for the different scripts (installation, cronjob, CLI, etc.). However, it is not used consistently and we prefer to rely on PERL5LIB.
If upgrading ancient Koha systems from tarballs double-check that PERL5LIB is set in crontab.
|
Version(s) released in: |
22.05.00
|
Circulation function: | |||
Attachments: |
Bug 28617: Remove kohalib.pl and rely on PERL5LIB
Bug 28617: Remove kohalib.pl and rely on PERL5LIB Bug 28617: (QA follow-up) Restore FindBin in two places Bug 28617: Remove kohalib.pl and rely on PERL5LIB Bug 28617: (QA follow-up) Restore FindBin in two places |
Description
Jonathan Druart
2021-06-23 09:45:44 UTC
This is not an enforced rule for all our CLI scripts, if it was really useful for someone we would have heard about them. Must admit, I've never entirely understood what this script was all about and why we didn't set PERL5LIB somewhere instead.. I'm not sure recent scripts have included it and I've not come across issues using those (either as standard, dev or package installs). Perhaps ask Galen if he knows of a reason to keep it? We should remove it and replace all occurrences like: eval { require "$FindBin::Bin/../kohalib.pl" }; I think the idea was to prevent some lib being replaced by a malicious one on a different path. Pretty much like the . fix Perl added. (In reply to Jonathan Druart from comment #0) > This script is used by command line scripts to load the Koha lib. > Should not we rely on PERL5LIB instead? +1 If you're interested in the history, make yourself a hot beverage of your choice and read http://koha.1045719.n5.nabble.com/RFC-installer-changes-td3065475.html Time marches on, and one of the motivations for having kohalib.pl - making it possible to install Koha without setting a single environment variable - has been obviated by the vast improvements in the ease of installing Koha. Consequently, I think kohalib.pl can go away. As far as upgrade worries are concerned, a release note advising anybody who is still actively upgrading ancient Koha systems from tarballs that they should double-check that PERL5LIB is set in crontabs should suffice. Created attachment 122935 [details] [review] Bug 28617: Remove kohalib.pl and rely on PERL5LIB The purpose of this script was to load the relevant Koha lib for the different scripts (installation, cronjob, CLI, etc.) However it is not used consistently and we prefer to rely on PERL5LIB. From bug 28617 comment 6 from Galen: """ Time marches on, and one of the motivations for having kohalib.pl - making it possible to install Koha without setting a single environment variable - has been obviated by the vast improvements in the ease of installing Koha. Consequently, I think kohalib.pl can go away. """ Test plan: confirm that the changes make sense and that kohalib.pl can be removed safely. Thanks, Galen! Created attachment 127916 [details] [review] Bug 28617: Remove kohalib.pl and rely on PERL5LIB The purpose of this script was to load the relevant Koha lib for the different scripts (installation, cronjob, CLI, etc.) However it is not used consistently and we prefer to rely on PERL5LIB. From bug 28617 comment 6 from Galen: """ Time marches on, and one of the motivations for having kohalib.pl - making it possible to install Koha without setting a single environment variable - has been obviated by the vast improvements in the ease of installing Koha. Consequently, I think kohalib.pl can go away. """ Test plan: confirm that the changes make sense and that kohalib.pl can be removed safely. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 127917 [details] [review] Bug 28617: (QA follow-up) Restore FindBin in two places Resolving: Name "FindBin::Bin" used only once: possible typo Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 128063 [details] [review] Bug 28617: Remove kohalib.pl and rely on PERL5LIB The purpose of this script was to load the relevant Koha lib for the different scripts (installation, cronjob, CLI, etc.) However it is not used consistently and we prefer to rely on PERL5LIB. From bug 28617 comment 6 from Galen: """ Time marches on, and one of the motivations for having kohalib.pl - making it possible to install Koha without setting a single environment variable - has been obviated by the vast improvements in the ease of installing Koha. Consequently, I think kohalib.pl can go away. """ Test plan: confirm that the changes make sense and that kohalib.pl can be removed safely. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 128064 [details] [review] Bug 28617: (QA follow-up) Restore FindBin in two places Resolving: Name "FindBin::Bin" used only once: possible typo Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> ALl works as expected, no additional cases found. QA scripts happy. Passing QA Pushed to master for 22.05, thanks to everybody involved [U+1F984] |