No point in leaving a mess of empty directories when Xapian
doesn't load.
if ($self->{creat}) {
require File::Path;
$self->lock_acquire;
- File::Path::mkpath($dir);
+
+ # don't create empty Xapian directories if we don't need Xapian
+ my $is_part = defined($self->{partition});
+ if (!$is_part || ($is_part && need_xapian($self))) {
+ File::Path::mkpath($dir);
+ }
}
return unless defined $flag;
$self->{xdb} = Search::Xapian::WritableDatabase->new($dir, $flag);
is($nr, 1, '2nd message gone from mirror');
is_deeply([map { $_->{mid} } @$msgs], ['m@1'],
'message unavailable in mirror');
+
+ if ($v == 2 && $level eq 'basic') {
+ is_deeply([glob("$ibx->{mainrepo}/xap*/?/")], [],
+ 'no Xapian partition directories for v2 basic');
+ }
}
# we can probably cull some other tests and put full/medium tests, here