- 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";
- }
+ 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 $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() );
+ my $logdir = C4::Context->config('logdir');
+ my $dbversion = C4::Context->preference('Version');
+ my $kohaversion = Koha::version;
+ $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
+
+ 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";