--- trunk/Split.pm 2004/12/19 03:06:01 8 +++ trunk/Split.pm 2005/04/29 22:35:21 9 @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.02'; +our $VERSION = '0.03'; use SWISH::API; use Text::Iconv; @@ -417,7 +417,10 @@ my $swish_config = $self->make_config($s); my $swish = qq{| swish-e }; - $swish .= qq{ -u } if (-f $self->{'index'}.'/'.$s); + if (-f $self->{'index'}.'/'.$s) { + $swish .= qq{ -u }; + $self->{'slice'}->{$s}->{'update_mode'}++; + } $swish .= qq{ -S prog -c } . $swish_config; $self->_debug("creating slice $s using $swish"); @@ -459,9 +462,12 @@ use bytes; # as opposed to chars my $fh = $self->{'slice'}->{$s}->{'h'} || confess "handle for slice $s undefined"; + + my $update_header = "Update-Mode: Index\n"; + $update_header = '' unless ($self->{'slice'}->{$s}->{'update_mode'}); + print { $fh } "Path-Name: $path\n". - "Content-Length: ".(length($xml)+1)."\n". - "Update-Mode: Index\n". + "Content-Length: ".(length($xml)+1)."\n" . $update_header . "Document-Type: XML\n\n$xml\n"; $self->slice_output($s);