From 973c5efc349a1e5d604713a8991b68677f2601d9 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 27 Jun 2022 13:02:23 +0000 Subject: [PATCH] Bug 31055: Change the source statement in koha scripts Content-Type: text/plain; charset=utf-8 All references to koha-functions moved to sbin. git grep -l "bin/koha-functions.sh" | xargs sed -i -e's/usr\/share\/koha\/bin\/koha-functions.sh/usr\/sbin\/koha-functions.sh/g' Test plan: [1] Copy debian scripts to /usr/sbin locally. [2] Remove /usr/share/koha/bin/koha-functions.sh [3] Try a few scripts [4] git grep -E "[^s]bin/koha-funct". No occurrences? Signed-off-by: Marcel de Rooy --- debian/koha-common.init | 6 +++--- debian/koha-core.init | 6 +++--- debian/scripts/koha-create | 6 +++--- debian/scripts/koha-disable | 6 +++--- debian/scripts/koha-dump | 6 +++--- debian/scripts/koha-elasticsearch | 6 +++--- debian/scripts/koha-email-disable | 6 +++--- debian/scripts/koha-email-enable | 6 +++--- debian/scripts/koha-enable | 6 +++--- debian/scripts/koha-foreach | 6 +++--- debian/scripts/koha-indexer | 6 +++--- debian/scripts/koha-list | 6 +++--- debian/scripts/koha-mysql | 6 +++--- debian/scripts/koha-mysqlcheck | 6 +++--- debian/scripts/koha-passwd | 6 +++--- debian/scripts/koha-plack | 6 +++--- debian/scripts/koha-rebuild-zebra | 6 +++--- debian/scripts/koha-remove | 6 +++--- debian/scripts/koha-reset-passwd | 6 +++--- debian/scripts/koha-restore | 6 +++--- debian/scripts/koha-sip | 6 +++--- debian/scripts/koha-sitemap | 6 +++--- debian/scripts/koha-translate | 6 +++--- debian/scripts/koha-upgrade-schema | 6 +++--- debian/scripts/koha-worker | 6 +++--- debian/scripts/koha-z3950-responder | 6 +++--- debian/scripts/koha-zebra | 6 +++--- 27 files changed, 81 insertions(+), 81 deletions(-) diff --git a/debian/koha-common.init b/debian/koha-common.init index 12a85a64a7..207ca076f3 100755 --- a/debian/koha-common.init +++ b/debian/koha-common.init @@ -44,10 +44,10 @@ fi . /lib/lsb/init-functions # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/koha-core.init b/debian/koha-core.init index a7efbd8812..441462dbbb 100755 --- a/debian/koha-core.init +++ b/debian/koha-core.init @@ -44,10 +44,10 @@ fi . /lib/lsb/init-functions # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index c833b451ad..92444f5b4d 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -22,10 +22,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable index c8d699435f..8a11452d99 100755 --- a/debian/scripts/koha-disable +++ b/debian/scripts/koha-disable @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-dump b/debian/scripts/koha-dump index f8d2ad1fa1..ac55ef091f 100755 --- a/debian/scripts/koha-dump +++ b/debian/scripts/koha-dump @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-elasticsearch b/debian/scripts/koha-elasticsearch index a5428175ac..3b027583ef 100755 --- a/debian/scripts/koha-elasticsearch +++ b/debian/scripts/koha-elasticsearch @@ -19,10 +19,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-email-disable b/debian/scripts/koha-email-disable index 3d3d69797e..c51dc1f3ae 100755 --- a/debian/scripts/koha-email-disable +++ b/debian/scripts/koha-email-disable @@ -19,10 +19,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-email-enable b/debian/scripts/koha-email-enable index 7a941c4fbc..800c5897ca 100755 --- a/debian/scripts/koha-email-enable +++ b/debian/scripts/koha-email-enable @@ -19,10 +19,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-enable b/debian/scripts/koha-enable index 67cbc8bf85..c6e87305f6 100755 --- a/debian/scripts/koha-enable +++ b/debian/scripts/koha-enable @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-foreach b/debian/scripts/koha-foreach index 2f5a150fcb..52febc792c 100755 --- a/debian/scripts/koha-foreach +++ b/debian/scripts/koha-foreach @@ -21,10 +21,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-indexer b/debian/scripts/koha-indexer index 4635d2b40a..f8bed1debe 100755 --- a/debian/scripts/koha-indexer +++ b/debian/scripts/koha-indexer @@ -24,10 +24,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list index a88d37b892..1468c2d417 100755 --- a/debian/scripts/koha-list +++ b/debian/scripts/koha-list @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-mysql b/debian/scripts/koha-mysql index 4a09e51c77..e173c0b8f5 100755 --- a/debian/scripts/koha-mysql +++ b/debian/scripts/koha-mysql @@ -22,10 +22,10 @@ set -e umask 0077 # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-mysqlcheck b/debian/scripts/koha-mysqlcheck index d3b8363526..b9140a1f12 100755 --- a/debian/scripts/koha-mysqlcheck +++ b/debian/scripts/koha-mysqlcheck @@ -22,10 +22,10 @@ set -e umask 0077 # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-passwd b/debian/scripts/koha-passwd index 5be04b40d3..b2fbba3d28 100755 --- a/debian/scripts/koha-passwd +++ b/debian/scripts/koha-passwd @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack index 3dcce331a9..b68a94698c 100755 --- a/debian/scripts/koha-plack +++ b/debian/scripts/koha-plack @@ -26,10 +26,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-rebuild-zebra b/debian/scripts/koha-rebuild-zebra index 7dffdf3812..3c7d37484e 100755 --- a/debian/scripts/koha-rebuild-zebra +++ b/debian/scripts/koha-rebuild-zebra @@ -23,10 +23,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove index 7270661bc4..d267cd8ed9 100755 --- a/debian/scripts/koha-remove +++ b/debian/scripts/koha-remove @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-reset-passwd b/debian/scripts/koha-reset-passwd index 14cfe33f03..94a4cfecb1 100755 --- a/debian/scripts/koha-reset-passwd +++ b/debian/scripts/koha-reset-passwd @@ -21,10 +21,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-restore b/debian/scripts/koha-restore index ede23ad18d..2d5c882d66 100755 --- a/debian/scripts/koha-restore +++ b/debian/scripts/koha-restore @@ -20,10 +20,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-sip b/debian/scripts/koha-sip index 402e9fa2e3..4e48fc5d21 100755 --- a/debian/scripts/koha-sip +++ b/debian/scripts/koha-sip @@ -25,10 +25,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-sitemap b/debian/scripts/koha-sitemap index 89b07e5e81..0cc728d2ac 100755 --- a/debian/scripts/koha-sitemap +++ b/debian/scripts/koha-sitemap @@ -25,10 +25,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-translate b/debian/scripts/koha-translate index b9a8ec835d..4c5ac346b9 100755 --- a/debian/scripts/koha-translate +++ b/debian/scripts/koha-translate @@ -23,10 +23,10 @@ set -e # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-upgrade-schema b/debian/scripts/koha-upgrade-schema index da50d41f10..878e4e15d4 100755 --- a/debian/scripts/koha-upgrade-schema +++ b/debian/scripts/koha-upgrade-schema @@ -22,10 +22,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-worker b/debian/scripts/koha-worker index 3d3f26257f..d446c095d6 100755 --- a/debian/scripts/koha-worker +++ b/debian/scripts/koha-worker @@ -23,10 +23,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-z3950-responder b/debian/scripts/koha-z3950-responder index 7f34bb4736..8b6f4e8b26 100755 --- a/debian/scripts/koha-z3950-responder +++ b/debian/scripts/koha-z3950-responder @@ -27,10 +27,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi diff --git a/debian/scripts/koha-zebra b/debian/scripts/koha-zebra index 0bd11aa7bc..73ae8470b3 100755 --- a/debian/scripts/koha-zebra +++ b/debian/scripts/koha-zebra @@ -25,10 +25,10 @@ set -e [ -r /etc/default/koha-common ] && . /etc/default/koha-common # include helper functions -if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then - . "/usr/share/koha/bin/koha-functions.sh" +if [ -f "/usr/sbin/koha-functions.sh" ]; then + . "/usr/sbin/koha-functions.sh" else - echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 + echo "Error: /usr/sbin/koha-functions.sh not present." 1>&2 exit 1 fi -- 2.20.1