From 3dde6fa1268e2f86f10f26b7d427598e582aed2a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 20 Jan 2021 14:04:43 +0900 Subject: lei: allow more mbox inode types We may attempt to write an mbox to any terminal, block, or character device, not just regular files and FIFOs/pipes. The only thing that is known to not work is a directory. Sockets may be possible with some OSes (e.g. Plan 9) or filesystems. This fixes t/lei.t on FreeBSD 11.x --- lib/PublicInbox/LeiOverview.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiOverview.pm') diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index dcc3088b..cab2b055 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -42,12 +42,10 @@ sub detect_fmt ($$) { my ($lei, $dst) = @_; if ($dst =~ m!\A([:/]+://)!) { $lei->fail("$1 support not implemented, yet\n"); - } elsif (!-e $dst) { - 'maildir'; # the default + } elsif (!-e $dst || -d _) { + 'maildir'; # the default TODO: MH? } elsif (-f _ || -p _) { $lei->fail("unable to determine mbox family of $dst\n"); - } elsif (-d _) { # TODO: MH? - 'maildir'; } else { $lei->fail("unable to determine format of $dst\n"); } -- cgit v1.2.3-24-ge0c7