From 97290c4f351fa557a0c88bdb38e627720dd902e0 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 --- 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 da50d41f107..14ad1cd73dd 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 00000000000..ada3a3c3e1b --- /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 4bedcb16116..3ce6a4ccca6 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 -- 2.34.1