--- trunk/all2xml.pl 2003/07/13 13:22:50 90 +++ trunk/all2xml.pl 2003/07/13 21:57:12 97 @@ -124,6 +124,10 @@ # init vars so that we go into while... ($swish,$display) = (1,1); + # placeholder for all repeatable entries for index + my @index_data; + my $index_filter; + # while because of repeatable fields while ($swish || $display) { ($swish,$display) = parse_format($type, $format,$row,$repeat_off++,$import2cp); @@ -168,14 +172,21 @@ # type="index" ; insert into index if ($i && $display) { - my $index_data = $display; - if ($filter) { - no strict 'refs'; - foreach my $d (&$filter($index_data)) { - $index->insert($field, $d, $path); - } - } else { - $index->insert($field, $index_data, $path); + push @index_data, $display; + $index_filter = $filter if ($filter); + } + } + + # fill data in index + if (@index_data) { + if ($index_filter) { + no strict 'refs'; + foreach my $d (&$index_filter(@index_data)) { + $index->insert($field, $d, $path); + } + } else { + foreach my $d (@index_data) { + $index->insert($field, $d, $path); } } } @@ -265,6 +276,8 @@ $cfg_global->val('global', 'dbi_passwd') || '', ); +my $show_progress = $cfg_global->val('global', 'show_progress'); + foreach my $database ($cfg->Sections) { my $type = lc($cfg -> val($database, 'type')) || die "$database doesn't have 'type' defined"; @@ -281,7 +294,7 @@ # output current progress indicator my $last_p = 0; sub progress { - #return if (! $opts{q}); # FIXME + # XXX return if ($show_progress ne ""); my $current = shift; my $total = shift || 1; my $p = int($current * 100 / $total);