Bugzilla – Attachment 184798 Details for
Bug 39740
[Follow-up of 36932] Split dev_install into git_install and debug_mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39740: Add is_git_install and is_test_system
Bug-39740-Add-isgitinstall-and-istestsystem.patch (text/plain), 3.61 KB, created by
Marcel de Rooy
on 2025-07-29 12:56:32 UTC
(
hide
)
Description:
Bug 39740: Add is_git_install and is_test_system
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-07-29 12:56:32 UTC
Size:
3.61 KB
patch
obsolete
>From 9337ba9dca4233f95f944c458ee6d4780a05c68f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 16 Jul 2025 16:59:07 +0200 >Subject: [PATCH] Bug 39740: Add is_git_install and is_test_system >Content-Type: text/plain; charset=utf-8 > >Test plan: >Copy koha-functions.sh to /usr/share/koha/bin. >Source bin/koha-functions.sh ('. bin/koha-functions.sh') > >Test in bash (Yes expected; adjust instance name): > GIT_INSTALL=1; if is_git_install your_instance; then echo Yes; fi >Add/set git_install to 1 in koha-conf.xml. >Test in bash (Yes expected): > unset GIT_INSTALL; if is_git_install your_instance; then echo Yes; fi >Set git_install to 0 in koha-conf.xml. >Test in bash (No expected): > unset GIT_INSTALL; if ! is_git_install your_instance; then echo No; fi >Remove git_install and add/set dev_install to 1 in koha-conf.xml. >Test in bash (Yes expected): > unset GIT_INSTALL; if is_git_install your_instance; then echo Yes; fi > >A few similar tests with test_system. >Add/set test_system to 0 in koha-conf.xml. >Test in bash (Yes expected): > TEST_SYSTEM=1; if is_test_system your_instance; then echo Yes; fi >Test in bash (No expected): > unset TEST_SYSTEM; if ! is_test_system your_instance; then echo No; fi > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > debian/scripts/koha-functions.sh | 53 ++++++++++++++++++++++++++------ > 1 file changed, 44 insertions(+), 9 deletions(-) > >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index 90ccf1611e..c120c2eb42 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -367,22 +367,57 @@ is_elasticsearch_enabled() > > adjust_paths_dev_install() > { >-# Adjust KOHA_HOME, PERL5LIB for dev installs, as indicated by >-# corresponding tag in koha-conf.xml >+# Adjust KOHA_HOME, PERL5LIB, KOHA_BINDIR for git installs > > local instancename=$1 >- local dev_install="" > >+ if is_git_install $instancename; then >+ KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir) >+ PERL5LIB="$KOHA_HOME:$KOHA_HOME/lib" >+ KOHA_BINDIR=misc >+ else >+ KOHA_BINDIR=bin >+ fi >+} >+ >+is_git_install() >+{ >+ local instancename=$1 git_install >+ >+ # env var GIT_INSTALL overrules koha-conf entry >+ if [ -n "$GIT_INSTALL" ]; then >+ if [ "$GIT_INSTALL" != "0" ]; then return 0; else return 1; fi >+ fi >+ >+ # now check koha-conf; looking at dev_install as historical fallback > if [ "$instancename" != "" ] && is_instance $instancename; then >- dev_install=$(run_safe_xmlstarlet $instancename dev_install) >+ git_install=$(run_safe_xmlstarlet $instancename git_install) >+ if [ -z "$git_install" ]; then git_install=$(run_safe_xmlstarlet $instancename dev_install); fi > fi >+ if [ -n "$git_install" ] && [ "$git_install" != "0" ]; then >+ return 0; # true >+ else >+ return 1 >+ fi >+} > >- if [ "$dev_install" != "" ] && [ "$dev_install" != "0" ]; then >- DEV_INSTALL=1 >- KOHA_HOME=$(run_safe_xmlstarlet $instancename intranetdir) >- PERL5LIB="$KOHA_HOME:$KOHA_HOME/lib" >+is_test_system() >+{ >+ local instancename=$1 test_system >+ >+ # env var TEST_SYSTEM overrules koha-conf entry >+ if [ -n "$TEST_SYSTEM" ]; then >+ if [ "$TEST_SYSTEM" != "0" ]; then return 0; else return 1; fi >+ fi >+ >+ # now check koha-conf >+ if [ "$instancename" != "" ] && is_instance $instancename; then >+ test_system=$(run_safe_xmlstarlet $instancename test_system) >+ fi >+ if [ -n "$test_system" ] && [ "test_system" != "0" ]; then >+ return 0; # true > else >- DEV_INSTALL="" >+ return 1 > fi > } > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39740
:
184187
|
184432
|
184798
|
184799
|
184800
|
184801
|
184802
|
184803
|
184804
|
184873
|
184874
|
184920
|
184989
|
184990
|
184991
|
184992
|
184993
|
184994
|
184995
|
184996
|
184997
|
184998