From 679feb04fa3ed74862d6d8e5388632b2d2e6683d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 30 Jul 2025 13:17:36 +0200 Subject: [PATCH] Bug 39740: (QA follow-up) Rename test_system/TEST_SYSTEM See comment30 and comment36. Result of two sed's: git grep -l test_system | xargs sed -i -e "s/test_system/debug_mode/g" git grep -l TEST_SYSTEM | xargs sed -i -e "s/TEST_SYSTEM/DEBUG_MODE/g" The next patch will take care of the debugger options in the plack and z3950 responder scripts. Test plan: Read the patch. (Testing in next patch.) git grep -i test_system Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- debian/scripts/koha-functions.sh | 14 +++++++------- debian/scripts/koha-plack | 2 +- debian/scripts/koha-z3950-responder | 4 ++-- debian/templates/koha-conf-site.xml.in | 4 ++-- etc/koha-conf.xml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh index 367260a4291..8f2d15c9449 100755 --- a/debian/scripts/koha-functions.sh +++ b/debian/scripts/koha-functions.sh @@ -401,20 +401,20 @@ is_git_install() fi } -is_test_system() +is_debug_mode() { - local instancename=$1 test_system + local instancename=$1 debug_mode - # env var TEST_SYSTEM overrules koha-conf entry - if [ -n "$TEST_SYSTEM" ]; then - if [ "$TEST_SYSTEM" != "0" ]; then return 0; else return 1; fi + # env var DEBUG_MODE overrules koha-conf entry + if [ -n "$DEBUG_MODE" ]; then + if [ "$DEBUG_MODE" != "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) + debug_mode=$(run_safe_xmlstarlet $instancename debug_mode) fi - if [ -n "$test_system" ] && [ "test_system" != "0" ]; then + if [ -n "$debug_mode" ] && [ "debug_mode" != "0" ]; then return 0; # true else return 1 diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack index 3e9816a400b..661b490cad2 100755 --- a/debian/scripts/koha-plack +++ b/debian/scripts/koha-plack @@ -92,7 +92,7 @@ start_plack() instance_user="${instancename}-koha" - if is_test_system ${instancename} || [ -n "$development_environment" ]; then + if is_debug_mode ${instancename} || [ -n "$development_environment" ]; then environment="development" else environment="deployment" diff --git a/debian/scripts/koha-z3950-responder b/debian/scripts/koha-z3950-responder index d8c4a49addc..97fd6b88fa7 100755 --- a/debian/scripts/koha-z3950-responder +++ b/debian/scripts/koha-z3950-responder @@ -86,7 +86,7 @@ start_z3950() logging="-l /var/log/koha/${instancename}/z3950.log" Z3950RESPONDER="/usr/bin/perl $KOHA_HOME/$KOHA_BINDIR/z3950_responder.pl" - if [ "$debug_mode" = "yes" ] && is_test_system $instancename; then + if [ "$debug_mode" = "yes" ] && is_debug_mode $instancename; then environment="development" daemonize="" logging="" # remote debugger takes care @@ -298,7 +298,7 @@ if [ $# -gt 0 ]; then PERL5LIB=$PERL5LIB:$KOHA_HOME/installer:$KOHA_HOME/lib/installer # If debug mode is enabled, add the debugger lib path # to PERL5LIB if appropriate - if [ "$debug_mode" = "yes" ] && is_test_system $name; then + if [ "$debug_mode" = "yes" ] && is_debug_mode $name; then if [ "$debugger_path" != "" ]; then PERL5LIB="${debugger_path}":$PERL5LIB fi diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 2c54b885b98..7da3ee0dc3a 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -411,9 +411,9 @@ __END_SRU_PUBLICSERVER__ + debug_mode is used to differentiate production from test systems (see for example koha-plack) --> 0 - 0 + 0 diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 5141a84df64..a662ed0cab9 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -230,9 +230,9 @@ + debug_mode is used to differentiate production from test systems (see for example koha-plack) --> 0 - 0 + 0 -- 2.50.1