From 7f22619001ae25abc5ff2a69162d2c11bbfa1d5a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 16 May 2016 12:15:06 -0300 Subject: [PATCH] Bug 16506: (Followup) remove warnings Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- misc/migration_tools/rebuild_zebra.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index fb06aabf2e..595673fcf4 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -127,14 +127,6 @@ if ($process_zebraqueue and $do_not_clear_zebraqueue) { die $msg; } -if ($reset) { - $noshadow = 1; -} - -if ($noshadow) { - $noshadow = ' -n '; -} - if ($daemon_mode) { # incompatible flags handled above: help, reset, and do_not_clear_zebraqueue if ($skip_export or $keep_export or $skip_index or @@ -815,10 +807,15 @@ sub do_indexing { my $zebra_config = C4::Context->zebraconfig($zebra_server)->{'config'}; my $zebra_db_dir = C4::Context->zebraconfig($zebra_server)->{'directory'}; + $noshadow //= ''; + + if ($noshadow or $reset_index) { + $noshadow = '-n'; + } + system("zebraidx -c $zebra_config $zebraidx_log_opt -g $record_format -d $zebra_db_name init") if $reset_index; system("zebraidx -c $zebra_config $zebraidx_log_opt $noshadow -g $record_format -d $zebra_db_name $op $record_dir"); system("zebraidx -c $zebra_config $zebraidx_log_opt -g $record_format -d $zebra_db_name commit") unless $noshadow; - } sub _flock { -- 2.39.5