about summary refs log tree commit homepage
path: root/lib/PublicInbox/OverIdx.pm
diff options
authorEric Wong <e@80x24.org>2020-12-31 13:24:36 +0000
committerEric Wong <e@80x24.org>2020-12-31 13:24:36 +0000
commit0c8106d44f317175e122744b43407bf067183175 (patch)
treef59296dc3c63c8ca1dd8445821f43777333ba30e /lib/PublicInbox/OverIdx.pm
parent9d29ceda4eb8c9973749d74b928416f5c3cc78f8 (diff)
parent0f461dcd3317f44670e2fc50346f87ff41e80127 (diff)
* origin/master: (58 commits)
  ds: flatten + reuse @events, epoll_wait style fixes
  ds: simplify EventLoop implementation
  check defined return value for localized slurp errors
  import: check for git->qx errors, clearer return values
  git: qx: avoid extra "local" for scalar context case
  search: remove {mset} option for ->mset method
  search: remove pointless {relevance} setting
  miscsearch: take reopen from Search and use it
  extsearch: unconditionally reopen on access
  extindex: allow using --all without EXTINDEX_DIR
  extindex: add undocumented --no-scan switch
  extindex: enable autoflush on STDOUT/STDERR
  extindex: various --watch signal handling fixes
  extindex: --watch for inotify-based updates
  eml: fix undefined vars on <Perl 5.28
  t/config: test --get-urlmatch for git <2.26
  default to CORE::warn in $SIG{__WARN__} handlers
  inbox: name variable for values loop iterator
  inboxidle: avoid needless syscalls on refresh
  inboxidle: clue users into resolving ENOSPC from inotify
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm
index c8630ddb..bc2e3ef4 100644
--- a/lib/PublicInbox/OverIdx.pm
+++ b/lib/PublicInbox/OverIdx.pm
@@ -473,10 +473,14 @@ sub dbh_close {
 sub create {
         my ($self) = @_;
-        unless (-r $self->{filename}) {
+        my $fn = $self->{filename} // do {
+                Carp::confess('BUG: no {filename}') unless $self->{dbh};
+                return;
+        };
+        unless (-r $fn) {
                 require File::Path;
                 require File::Basename;
-                File::Path::mkpath(File::Basename::dirname($self->{filename}));
+                File::Path::mkpath(File::Basename::dirname($fn));
         # create the DB: