View | Details | Raw Unified | Return to bug 17666
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-3 / +15 lines)
Lines 47-53 use MARC::File::XML ( BinaryEncoding => 'utf8' ); Link Here
47
47
48
use File::Path qw[remove_tree]; # perl core module
48
use File::Path qw[remove_tree]; # perl core module
49
use File::Spec;
49
use File::Spec;
50
use Path::Tiny;
51
50
52
# FIXME - The user might be installing a new database, so can't rely
51
# FIXME - The user might be installing a new database, so can't rely
53
# on /etc/koha.conf anyway.
52
# on /etc/koha.conf anyway.
Lines 13707-13713 foreach my $file ( sort readdir $dirh ) { Link Here
13707
        my $installer = C4::Installer->new();
13706
        my $installer = C4::Installer->new();
13708
        my $rv = $installer->load_sql( $update_dir . $file ) ? 0 : 1;
13707
        my $rv = $installer->load_sql( $update_dir . $file ) ? 0 : 1;
13709
    } elsif ( $file =~ /\.perl$/ ) {
13708
    } elsif ( $file =~ /\.perl$/ ) {
13710
        my $code = path( $update_dir . $file )->slurp_utf8;
13709
        my $code = slurp_file( $update_dir . $file );
13711
        eval $code;
13710
        eval $code;
13712
        say "Atomic update generated errors: $@" if $@;
13711
        say "Atomic update generated errors: $@" if $@;
13713
    }
13712
    }
Lines 13715-13720 foreach my $file ( sort readdir $dirh ) { Link Here
13715
13714
13716
=head1 FUNCTIONS
13715
=head1 FUNCTIONS
13717
13716
13717
=head2 slurp_file
13718
13719
=cut
13720
13721
sub slurp_file {
13722
    my ($file) = @_;
13723
    local $/ = undef;
13724
    open( FILE, '<:encoding(UTF-8)', $file ) or die "Couldn't open file: $!";
13725
    binmode FILE;
13726
    my $string = <FILE>;
13727
    close FILE;
13728
    return $string;
13729
}
13730
13718
=head2 TableExists($table)
13731
=head2 TableExists($table)
13719
13732
13720
=cut
13733
=cut
13721
- 

Return to bug 17666