Lines 321-339
elsif ( $step && $step == 3 ) {
Link Here
|
321 |
warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; |
321 |
warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; |
322 |
} |
322 |
} |
323 |
|
323 |
|
324 |
my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl"; |
324 |
my $koha39 =~ "3.0900000"; |
325 |
my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0); |
325 |
my $cmd; |
|
|
326 |
# Old updatedatabase method |
327 |
my $current_version = C4::Context->preference('Version'); |
328 |
if ( $current_version < $koha39 ) { |
329 |
$cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl"; |
330 |
my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0); |
331 |
print_std( "updatedatabase.pl", $stdout_buf, $stderr_buf ); |
326 |
|
332 |
|
327 |
if (@$stdout_buf) { |
|
|
328 |
$template->param(update_report => [ map { { line => $_ } } split(/\n/, join('', @$stdout_buf)) ] ); |
329 |
$template->param(has_update_succeeds => 1); |
330 |
} |
331 |
if (@$stderr_buf) { |
332 |
$template->param(update_errors => [ map { { line => $_ } } split(/\n/, join('', @$stderr_buf)) ] ); |
333 |
$template->param(has_update_errors => 1); |
334 |
warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; |
335 |
foreach my $line (@$stderr_buf) {warn "$line\n";} |
336 |
} |
333 |
} |
|
|
334 |
$cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/update.pl -all -min=$current_version"; |
335 |
my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0); |
336 |
print_std( "update.pl", $stdout_buf, $stderr_buf ); |
337 |
|
337 |
|
338 |
$template->param( $op => 1 ); |
338 |
$template->param( $op => 1 ); |
339 |
} |
339 |
} |
Lines 406-409
else {
Link Here
|
406 |
} |
406 |
} |
407 |
} |
407 |
} |
408 |
} |
408 |
} |
|
|
409 |
|
410 |
sub print_std { |
411 |
my ( $script, $stdout_buf, $stderr_buf ) = @_; |
412 |
if (@$stdout_buf) { |
413 |
$template->param(update_report => [ map { { line => $_ } } split(/\n/, join('', @$stdout_buf)) ] ); |
414 |
$template->param(has_update_succeeds => 1); |
415 |
} |
416 |
if (@$stderr_buf) { |
417 |
$template->param(update_errors => [ map { { line => $_ } } split(/\n/, join('', @$stderr_buf)) ] ); |
418 |
$template->param(has_update_errors => 1); |
419 |
warn "The following errors were returned while attempting to run the $script script:\n"; |
420 |
foreach my $line (@$stderr_buf) {warn "$line\n";} |
421 |
} |
422 |
} |
423 |
|
424 |
|
409 |
output_html_with_http_headers $query, $cookie, $template->output; |
425 |
output_html_with_http_headers $query, $cookie, $template->output; |
410 |
- |
|
|