From 26de0bfaa0efc69e4b716a08263a4e007dd12030 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 5 Sep 2024 12:03:09 +0200 Subject: [PATCH] Bug 34088: Move the 'needs update' test to a separate script Signed-off-by: Katrin Fischer --- debian/scripts/koha-upgrade-schema | 2 +- installer/data/mysql/needs_update.pl | 6 ++++++ installer/data/mysql/updatedatabase.pl | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100755 installer/data/mysql/needs_update.pl diff --git a/debian/scripts/koha-upgrade-schema b/debian/scripts/koha-upgrade-schema index da50d41f10..14ad1cd73d 100755 --- a/debian/scripts/koha-upgrade-schema +++ b/debian/scripts/koha-upgrade-schema @@ -43,7 +43,7 @@ do echo "Upgrading database schema for $name" KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \ PERL5LIB=$PERL5LIB \ - "$CGI_PATH/installer/data/mysql/updatedatabase.pl" + "$CGI_PATH/installer/data/mysql/needs_update.pl" && "$CGI_PATH/installer/data/mysql/updatedatabase.pl" else die "Error: Invalid instance name $name" fi diff --git a/installer/data/mysql/needs_update.pl b/installer/data/mysql/needs_update.pl new file mode 100755 index 0000000000..ada3a3c3e1 --- /dev/null +++ b/installer/data/mysql/needs_update.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl + +use Modern::Perl; + +use Koha::Installer; +exit !Koha::Installer->needs_update; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4bedcb1611..3ce6a4ccca 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -29,13 +29,6 @@ use Modern::Perl; -BEGIN { - use Koha::Installer; - if ( !Koha::Installer->needs_update ) { - exit; - } -} - use feature 'say'; # CPAN modules