user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 0/5] lei: preserve keywords across queries
@ 2021-03-20 10:04  6% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-20 10:04 UTC (permalink / raw)
  To: meta

2/5 is the major milestone to me, it took me a long while to
figure out and arrive at.

PATCH 1/5 made things click, and
<https://public-inbox.org/meta/20210320023800.1809-1-e@80x24.org/>
("lei_store: initialize IPC lock properly") was also needed :x

There'll still need to be some followup to support import,
and also to deal with public-inbox-edit/purge in externals.

Inotify + EVFILT_VNODE support should make things sweeter, too.

Eric Wong (5):
  lei: All Local Externals: bare git dir for alternates
  lei q: support vmd for external-only messages
  lei q: put keywords on one line in --pretty output
  lei_to_mail: match mutt order of status headers
  lei: tie ALE lifetime to config file

 MANIFEST                       |   1 +
 lib/PublicInbox/LEI.pm         |  15 +++++
 lib/PublicInbox/LeiALE.pm      | 111 +++++++++++++++++++++++++++++++++
 lib/PublicInbox/LeiOverview.pm |  12 +++-
 lib/PublicInbox/LeiQuery.pm    |   1 +
 lib/PublicInbox/LeiSearch.pm   |  37 +++++++----
 lib/PublicInbox/LeiStore.pm    |  82 ++++++++++++++----------
 lib/PublicInbox/LeiToMail.pm   |  38 ++++++-----
 lib/PublicInbox/LeiXSearch.pm  |  44 +++----------
 lib/PublicInbox/Lock.pm        |   2 +-
 lib/PublicInbox/Over.pm        |  22 ++++++-
 lib/PublicInbox/OverIdx.pm     |  10 ---
 lib/PublicInbox/SearchIdx.pm   |   3 +
 t/eml.t                        |   2 +
 t/lei-convert.t                |   3 +-
 t/lei-externals.t              |   3 +-
 t/lei-q-kw.t                   |  59 ++++++++++++++++--
 t/lei-q-remote-import.t        |   4 +-
 t/lei-q-thread.t               |   7 ++-
 t/lei_to_mail.t                |   2 +-
 t/lei_xsearch.t                |  22 ++++++-
 21 files changed, 355 insertions(+), 125 deletions(-)
 create mode 100644 lib/PublicInbox/LeiALE.pm


^ permalink raw reply	[relevance 6%]

* [PATCH] lei_store: initialize IPC lock properly
@ 2021-03-20  2:38  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-20  2:38 UTC (permalink / raw)
  To: meta

This was causing errors in a mass keyword import patch
I'm working on.
---
 lib/PublicInbox/IPC.pm      | 1 +
 lib/PublicInbox/LEI.pm      | 8 ++++----
 lib/PublicInbox/LeiStore.pm | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm
index 1fa67d00..cf3723f7 100644
--- a/lib/PublicInbox/IPC.pm
+++ b/lib/PublicInbox/IPC.pm
@@ -177,6 +177,7 @@ sub ipc_worker_stop {
 # and writing to the same store
 sub ipc_lock_init {
 	my ($self, $f) = @_;
+	$f // die 'BUG: no filename given';
 	require PublicInbox::Lock;
 	$self->{-ipc_lock} //= bless { lock_path => $f }, 'PublicInbox::Lock'
 }
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index a0986f38..d20ba744 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -83,7 +83,7 @@ sub rel2abs ($$) {
 	File::Spec->rel2abs($p, $pwd);
 }
 
-sub _store_path ($) {
+sub store_path ($) {
 	my ($self) = @_;
 	rel2abs($self, ($self->{env}->{XDG_DATA_HOME} //
 		($self->{env}->{HOME} // '/nonexistent').'/.local/share')
@@ -188,7 +188,7 @@ our %CMD = ( # sorted in order of importance/use:
 	}, qw(config-file|system|global|file|f=s), # for conflict detection
 	 qw(C=s@), pass_through('git config') ],
 'init' => [ '[DIRNAME]', sub {
-	"initialize storage, default: "._store_path($_[0]);
+	"initialize storage, default: ".store_path($_[0]);
 	}, qw(quiet|q C=s@) ],
 'daemon-kill' => [ '[-SIGNAL]', 'signal the lei-daemon',
 	# "-C DIR" conflicts with -CHLD, here, and chdir makes no sense, here
@@ -640,7 +640,7 @@ sub _lei_store ($;$) {
 	$cfg->{-lei_store} //= do {
 		require PublicInbox::LeiStore;
 		my $dir = $cfg->{'leistore.dir'};
-		$dir //= $creat ? _store_path($self) : return;
+		$dir //= $creat ? store_path($self) : return;
 		PublicInbox::LeiStore->new($dir, { creat => $creat });
 	};
 }
@@ -689,7 +689,7 @@ sub lei_init {
 	my ($self, $dir) = @_;
 	my $cfg = _lei_cfg($self, 1);
 	my $cur = $cfg->{'leistore.dir'};
-	$dir //= _store_path($self);
+	$dir //= store_path($self);
 	$dir = rel2abs($self, $dir);
 	my @cur = stat($cur) if defined($cur);
 	$cur = File::Spec->canonpath($cur // $dir);
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index ae263914..26f975c3 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -261,7 +261,7 @@ sub write_prepare {
 	my ($self, $lei) = @_;
 	unless ($self->{-ipc_req}) {
 		require PublicInbox::LeiXSearch;
-		$self->ipc_lock_init;
+		$self->ipc_lock_init($lei->store_path . '/ipc.lock');
 		# Mail we import into lei are private, so headers filtered out
 		# by -mda for public mail are not appropriate
 		local @PublicInbox::MDA::BAD_HEADERS = ();

^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-20  2:38  7% [PATCH] lei_store: initialize IPC lock properly Eric Wong
2021-03-20 10:04  6% [PATCH 0/5] lei: preserve keywords across queries Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).