about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-03 15:51:44 -0600
committerEric Wong <e@80x24.org>2021-02-04 01:41:04 +0000
commita1aa7a3bf55ca5aa6e12294bc1f864dba8e63269 (patch)
tree7d3e76f35eefdf1408afe4245f373a7743b25a60 /lib
parent92dd30285b579204b242df3e12b57b926083b666 (diff)
downloadpublic-inbox-a1aa7a3bf55ca5aa6e12294bc1f864dba8e63269.tar.gz
The features we use for SharedKV could probably be implemented
with GDBM_File or SDBM_File, but that doesn't seem worth it at
the moment since we depend on SQLite elsewhere.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Config.pm2
-rw-r--r--lib/PublicInbox/Inbox.pm2
-rw-r--r--lib/PublicInbox/LeiDedupe.pm8
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 4f63bc93..a4b1756d 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -496,7 +496,7 @@ EOF
 
 sub _fill_ei ($$) {
         my ($self, $pfx) = @_;
-        require PublicInbox::ExtSearch;
+        eval { require PublicInbox::ExtSearch } or return;
         my $d = $self->{"$pfx.topdir"};
         defined($d) && -d $d ? PublicInbox::ExtSearch->new($d) : undef;
 }
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index bee44f8a..a1e34797 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -196,7 +196,7 @@ sub isrch { $_[0]->{isrch} // search($_[0]) }
 
 sub over {
         $_[0]->{over} //= eval {
-                my $srch = $_[0]->{search} //= eval {
+                my $srch = $_[0]->{search} //= do {
                         _cleanup_later($_[0]);
                         require PublicInbox::Search;
                         PublicInbox::Search->new($_[0]);
diff --git a/lib/PublicInbox/LeiDedupe.pm b/lib/PublicInbox/LeiDedupe.pm
index 5c83fd80..2114c0e8 100644
--- a/lib/PublicInbox/LeiDedupe.pm
+++ b/lib/PublicInbox/LeiDedupe.pm
@@ -3,7 +3,6 @@
 package PublicInbox::LeiDedupe;
 use strict;
 use v5.10.1;
-use PublicInbox::SharedKV;
 use PublicInbox::ContentHash qw(content_hash);
 use Digest::SHA ();
 
@@ -98,8 +97,11 @@ sub new {
         return if ($dd eq 'none' && substr($dst // '', -1) eq '/');
         my $m = "dedupe_$dd";
         $cls->can($m) or die "unsupported dedupe strategy: $dd\n";
-        my $skv = $dd eq 'none' ? undef : PublicInbox::SharedKV->new;
-
+        my $skv;
+        if ($dd ne 'none') {
+                require PublicInbox::SharedKV;
+                $skv = PublicInbox::SharedKV->new;
+        }
         # [ $skv, $eml_cb, $smsg_cb, "dedupe_$dd" ]
         bless [ $skv, undef, undef, $m ], $cls;
 }