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