* [PATCH 1/4] search: do not use $QP_FLAGS until Xapian is loaded
2021-01-01 5:47 4% [PATCH 0/4] TEST_RUN_MODE=0 fixes Eric Wong
@ 2021-01-01 5:47 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-01-01 5:47 UTC (permalink / raw)
To: meta
The default $QP_FLAGS won't be set until after Xapian is
loaded, duh...
This fixes t/imapd.t with TEST_RUN_MODE=0
---
lib/PublicInbox/Search.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 547b6fbe..0bdf6fc6 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -196,6 +196,7 @@ sub xdb_shards_flat ($) {
my $xpfx = $self->{xpfx};
my (@xdb, $slow_phrase);
load_xapian();
+ $self->{qp_flags} //= $QP_FLAGS;
if ($xpfx =~ m/xapian${\SCHEMA_VERSION}\z/) {
@xdb = ($X{Database}->new($xpfx));
$self->{qp_flags} |= FLAG_PHRASE() if !-f "$xpfx/iamchert";
@@ -232,7 +233,6 @@ sub mset_to_artnums {
sub xdb ($) {
my ($self) = @_;
$self->{xdb} //= do {
- $self->{qp_flags} //= $QP_FLAGS;
my @xdb = $self->xdb_shards_flat or return;
$self->{nshard} = scalar(@xdb);
my $xdb = shift @xdb;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] TEST_RUN_MODE=0 fixes
@ 2021-01-01 5:47 4% Eric Wong
2021-01-01 5:47 7% ` [PATCH 1/4] search: do not use $QP_FLAGS until Xapian is loaded Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-01-01 5:47 UTC (permalink / raw)
To: meta
Oops :x I should use TEST_RUN_MODE more often to give
my hands a rest. None of these surface with the quick
"check-run" target
Eric Wong (4):
search: do not use $QP_FLAGS until Xapian is loaded
t/lei: fix TEST_RUN_MODE=0, simplify oneshot fallback test
import: unset GIT_CONFIG with `git config --global'
treewide: reduce load_xapian* callsites
lib/PublicInbox/Import.pm | 1 +
lib/PublicInbox/LEI.pm | 1 -
lib/PublicInbox/LeiStore.pm | 5 +----
lib/PublicInbox/Search.pm | 2 +-
t/indexlevels-mirror.t | 4 +---
t/lei-oneshot.t | 17 -----------------
t/lei.t | 29 +++++++++++++++++------------
t/replace.t | 3 +--
8 files changed, 22 insertions(+), 40 deletions(-)
^ permalink raw reply [relevance 4%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-01 5:47 4% [PATCH 0/4] TEST_RUN_MODE=0 fixes Eric Wong
2021-01-01 5:47 7% ` [PATCH 1/4] search: do not use $QP_FLAGS until Xapian is loaded 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).