From 7f17df5c6f1892ef53f149a0ab24a5d917cce7d9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Dec 2020 13:51:27 +0000 Subject: lei_to_mail: start --augment, dedupe, bz2 and xz --augment will match the mairix(1) option of the same name to augment existing search results. We'll need to implement deduplication for a better user experience. mutt ships with compressed mbox support for bz2 and xz, at least, so we'll support those out-of-the-box. --- lib/PublicInbox/Lock.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/PublicInbox/Lock.pm') diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm index 7fd17745..f6eaa5ce 100644 --- a/lib/PublicInbox/Lock.pm +++ b/lib/PublicInbox/Lock.pm @@ -8,6 +8,7 @@ use v5.10.1; use Fcntl qw(:flock :DEFAULT); use Carp qw(croak); use PublicInbox::OnDestroy; +use File::Temp (); # we only acquire the flock if creating or reindexing; # PublicInbox::Import already has the lock on its own. @@ -40,4 +41,10 @@ sub lock_for_scope { PublicInbox::OnDestroy->new(\&lock_release, $self); } +sub new_tmp { + my ($cls, $ident) = @_; + my $tmp = File::Temp->new("$ident.lock-XXXXXX", TMPDIR => 1); + bless { lock_path => $tmp->filename, tmp => $tmp }, $cls; +} + 1; -- cgit v1.2.3-24-ge0c7