Lines 19-27
use File::Spec;
Link Here
|
19 |
use File::Basename; |
19 |
use File::Basename; |
20 |
use File::Find; |
20 |
use File::Find; |
21 |
use Test::Warn; |
21 |
use Test::Warn; |
|
|
22 |
use File::Temp qw/ tempdir /; |
23 |
use File::Path; |
22 |
|
24 |
|
23 |
system(dirname(__FILE__) . "/zebra_config.pl"); |
25 |
my $datadir = tempdir(); |
24 |
my $datadir = dirname(__FILE__) . "/data"; |
26 |
system(dirname(__FILE__) . "/zebra_config.pl $datadir"); |
|
|
27 |
my $sourcedir = dirname(__FILE__) . "/data"; |
25 |
|
28 |
|
26 |
my $QueryStemming = 0; |
29 |
my $QueryStemming = 0; |
27 |
my $QueryAutoTruncate = 0; |
30 |
my $QueryAutoTruncate = 0; |
Lines 197-203
my %itemtypes = (
Link Here
|
197 |
|
200 |
|
198 |
unlink("$datadir/zebra.log"); |
201 |
unlink("$datadir/zebra.log"); |
199 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios init"); |
202 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios init"); |
200 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios update $datadir/zebraexport/biblio"); |
203 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios update $sourcedir/zebraexport/biblio"); |
201 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios commit"); |
204 |
system("zebraidx -c $datadir/etc/koha/zebradb/zebra-biblios.cfg -v none,fatal,warn -g iso2709 -d biblios commit"); |
202 |
|
205 |
|
203 |
my $child = fork(); |
206 |
my $child = fork(); |
Lines 507-516
END {
Link Here
|
507 |
kill 9, $child; |
510 |
kill 9, $child; |
508 |
|
511 |
|
509 |
# Clean up the Zebra files since the child process was just shot |
512 |
# Clean up the Zebra files since the child process was just shot |
510 |
|
513 |
rmtree $datadir; |
511 |
find(sub { unlink($_) if ( -f $_ && m/\.(mf|pid|LCK)$/ ); }, "$datadir"); |
|
|
512 |
unlink("$datadir/var/run/zebradb/authoritysocket"); |
513 |
unlink("$datadir/var/run/zebradb/bibliosocket"); |
514 |
} |
514 |
} |
515 |
} |
515 |
} |
516 |
|
516 |
|