Hopefully this will make it easier to spot dependency
bugs in the future.
---
 lib/PublicInbox/LEI.pm      | 1 -
 lib/PublicInbox/LeiStore.pm | 5 +----
 t/indexlevels-mirror.t      | 4 +---
 t/replace.t                 | 3 +--
 4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 320a2bfc..2bc4a916 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -453,7 +453,6 @@ sub _lei_store ($;$) {
        my $cfg = _lei_cfg($self, $creat);
        $cfg->{-lei_store} //= do {
                require PublicInbox::LeiStore;
-               PublicInbox::SearchIdx::load_xapian_writable();
                my $dir = $cfg->{'leistore.dir'};
                $dir //= _store_path($self->{env}) if $creat;
                return unless $dir;
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index a23efed5..07a3198a 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -24,10 +24,7 @@ sub new {
        my (undef, $dir, $opt) = @_;
        my $eidx = PublicInbox::ExtSearchIdx->new($dir, $opt);
        my $self = bless { priv_eidx => $eidx }, __PACKAGE__;
-       if ($opt->{creat}) {
-               PublicInbox::SearchIdx::load_xapian_writable();
-               eidx_init($self);
-       }
+       eidx_init($self) if $opt->{creat};
        $self;
 }
 
diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t
index a2afbd74..53826aef 100644
--- a/t/indexlevels-mirror.t
+++ b/t/indexlevels-mirror.t
@@ -172,9 +172,7 @@ my $import_index_incremental = sub {
 $import_index_incremental->($PI_TEST_VERSION, 'basic', $mime);
 
 SKIP: {
-       require PublicInbox::Search;
-       PublicInbox::Search::load_xapian() or
-               skip('Xapian perl binding missing', 2);
+       require_mods(qw(Search::Xapian), 2);
        foreach my $l (qw(medium full)) {
                $import_index_incremental->($PI_TEST_VERSION, $l, $mime);
        }
diff --git a/t/replace.t b/t/replace.t
index 7135c863..51bdb964 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -186,8 +186,7 @@ test_replace(2, 'basic', $opt = { %$opt, post => \&pad_msgs 
});
 test_replace(2, 'basic', $opt = { %$opt, rotate_bytes => 1 });
 
 SKIP: {
-       require PublicInbox::Search;
-       PublicInbox::Search::load_xapian() or skip 'Search::Xapian missing', 8;
+       require_mods(qw(Search::Xapian), 8);
        for my $l (qw(medium)) {
                test_replace(2, $l, {});
                $opt = { pre => \&pad_msgs };
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to