- if (@$stdout_buf) {
- $template->param(update_report => [ map { { line => $_ } } split(/\n/, join('', @$stdout_buf)) ] );
- $template->param(has_update_succeeds => 1);
+ my $filename_suffix = join '_', $now, $dbversion, $kohaversion;
+ my ( $logfilepath, $logfilepath_errors ) = (
+ chk_log( $logdir, "updatedatabase_$filename_suffix" ),
+ chk_log( $logdir, "updatedatabase-error_$filename_suffix" )
+ );
+
+ my $cmd = C4::Context->config("intranetdir")
+ . "/installer/data/$info{dbms}/updatedatabase.pl >> $logfilepath 2>> $logfilepath_errors";
+
+ system($cmd );
+
+ my $fh;
+ open( $fh, "<", $logfilepath )
+ or die "Cannot open log file $logfilepath: $!";
+ my @report = <$fh>;
+ close $fh;
+ if (@report) {
+ $template->param( update_report =>
+ [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ]
+ );
+ $template->param( has_update_succeeds => 1 );