X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Finstall.pl;h=389dabd3b6ae858836d7d7aea317212e67e42f18;hb=05b4fd7d522436face13f45634671bae0151b013;hp=01360e636d3b9890cd402ac060df9bae0d369c6e;hpb=72f9f2239f9d71eec5e2cd987f445a25618d8027;p=koha_fer diff --git a/installer/install.pl b/installer/install.pl index 01360e636d..389dabd3b6 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -4,7 +4,7 @@ use strict; use warnings; use diagnostics; -use InstallAuth; +use C4::InstallAuth; use CGI; use IPC::Cmd; @@ -189,7 +189,6 @@ elsif ( $step && $step == 3 ) { } elsif ( $op && $op eq 'finish' ) { $installer->set_version_syspref(); - $installer->set_indexing_engine(0); # use Zebra # Installation is finished. # We just deny anybody access to install @@ -242,7 +241,7 @@ elsif ( $step && $step == 3 ) { $template->param( "frameworksloop" => $fwklist ); $template->param( "marcflavour" => ucfirst($marcflavour)); - my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice, $marcflavour); + my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice); $template->param( "en_sample_data" => $sample_defaulted_to_en); $template->param( "levelloop" => $levellist ); $template->param( "$op" => 1 ); @@ -312,24 +311,29 @@ elsif ( $step && $step == 3 ) { # Not 1st install, the only sub-step : update database # #Do updatedatabase And report - 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 $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); } + if (@$stderr_buf) { + $template->param(update_errors => [ map { { line => $_ } } split(/\n/, join('', @$stderr_buf)) ] ); + $template->param(has_update_errors => 1); + warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; + foreach my $line (@$stderr_buf) {warn "$line\n";} + } + $template->param( $op => 1 ); } else { @@ -378,8 +382,6 @@ elsif ( $step && $step == 3 ) { ); } } - - $dbh->disconnect; } } else { @@ -395,26 +397,10 @@ else { if ( $rq->execute ) { my ($version) = $rq->fetchrow; if ($version) { - $query->redirect("install.pl?step=3"); - exit; + print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3"); + exit; } } } } - -sub print_std { - my ( $script, $stdout_buf, $stderr_buf ) = @_; - if (@$stdout_buf) { - $template->param(update_report => [ map { { line => $_ } } split(/\n/, join('', @$stdout_buf)) ] ); - $template->param(has_update_succeeds => 1); - } - if (@$stderr_buf) { - $template->param(update_errors => [ map { { line => $_ } } split(/\n/, join('', @$stderr_buf)) ] ); - $template->param(has_update_errors => 1); - warn "The following errors were returned while attempting to run the $script script:\n"; - foreach my $line (@$stderr_buf) {warn "$line\n";} - } -} - - output_html_with_http_headers $query, $cookie, $template->output;