- my $koha39 = "3.0900028";
- my $cmd;
- # Old updatedatabase method
- my $current_version = C4::Context->preference('Version');
- if ( $current_version < $koha39 ) {
- $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl";
- my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
- print_std( "updatedatabase.pl", $stdout_buf, $stderr_buf );
- $current_version= $koha39;
+ if ( ! defined $ENV{PERL5LIB} ) {
+ my $find = "C4/Context.pm";
+ my $path = $INC{$find};
+ $path =~ s/\Q$find\E//;
+ $ENV{PERL5LIB} = "$path:$path/installer";
+ warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n";
+ }
+
+ my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl";
+ my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
+
+ if (@$stdout_buf) {
+ $template->param(update_report => [ map { { line => $_ } } split(/\n/, join('', @$stdout_buf)) ] );
+ $template->param(has_update_succeeds => 1);