unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: Re: [PATCH 3/4] search: support SWIG-generated Xapian.pm
Date: Mon, 23 Dec 2019 18:07:12 +0000	[thread overview]
Message-ID: <20191223180712.GA20619@dcvr> (raw)
In-Reply-To: <20191222221740.17114-4-e@80x24.org>

Eric Wong <e@80x24.org> wrote:
> More information about the status of the "Xapian" Perl module here:
> https://trac.xapian.org/ticket/523

> diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
> index 88c8dc70..7d83419d 100644
> --- a/lib/PublicInbox/Search.pm
> +++ b/lib/PublicInbox/Search.pm
> @@ -17,20 +17,42 @@ use PublicInbox::MIME;
>  use PublicInbox::MID qw/id_compress/;
>  use PublicInbox::Over;
>  my $QP_FLAGS;
> +our %X = map { $_ => 0 } qw(BoolWeight Database Enquire
> +			NumberValueRangeProcessor QueryParser Stem);
> +our $Xap; # 'Search::Xapian' or 'Xapian'
> +my $ENQ_ASCENDING;
> +
>  sub load_xapian () {
> -	$QP_FLAGS ||= eval {
> -		require Search::Xapian;
> -		Search::Xapian->import(qw(:standard));
> +	return 1 if defined $Xap;
> +	for my $x (qw(Xapian Search::Xapian)) {
> +		eval "require $x";
> +		next if $@;

Given the current status of "Xapian" not being in Debian (where
the Xapian package maintainer is also upstream), perhaps the
order should be swapped in case there's other misbehaviors not
uncovered by our test suite:

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 7d83419d..65c6ee83 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -24,7 +24,7 @@ my $ENQ_ASCENDING;
 
 sub load_xapian () {
 	return 1 if defined $Xap;
-	for my $x (qw(Xapian Search::Xapian)) {
+	for my $x (qw(Search::Xapian Xapian)) {
 		eval "require $x";
 		next if $@;
 


  reply	other threads:[~2019-12-23 18:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-22 22:17 [PATCH 0/4] support SWIG-generated Xapian binding Eric Wong
2019-12-22 22:17 ` [PATCH 1/4] testcommon: add require_mods method and use it Eric Wong
2019-12-22 22:17 ` [PATCH 2/4] searchidx: call "++" on PostingIterator instead of "->inc" Eric Wong
2019-12-22 22:17 ` [PATCH 3/4] search: support SWIG-generated Xapian.pm Eric Wong
2019-12-23 18:07   ` Eric Wong [this message]
2019-12-22 22:17 ` [PATCH 4/4] t/search.t: update permissions check for OpenBSD Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191223180712.GA20619@dcvr \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).