r61965 - in /branches/upstream/libsearch-xapian-perl/current: Changes META.yml Makefile.PL README XS/Enquire.xs Xapian.pm Xapian.xs Xapian/Enquire.pm t/search.t
olly at users.alioth.debian.org
olly at users.alioth.debian.org
Tue Aug 24 12:47:06 UTC 2010
Author: olly
Date: Tue Aug 24 12:46:57 2010
New Revision: 61965
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61965
Log:
[svn-upgrade] Integrating new upstream version, libsearch-xapian-perl (1.2.3.0)
Modified:
branches/upstream/libsearch-xapian-perl/current/Changes
branches/upstream/libsearch-xapian-perl/current/META.yml
branches/upstream/libsearch-xapian-perl/current/Makefile.PL
branches/upstream/libsearch-xapian-perl/current/README
branches/upstream/libsearch-xapian-perl/current/XS/Enquire.xs
branches/upstream/libsearch-xapian-perl/current/Xapian.pm
branches/upstream/libsearch-xapian-perl/current/Xapian.xs
branches/upstream/libsearch-xapian-perl/current/Xapian/Enquire.pm
branches/upstream/libsearch-xapian-perl/current/t/search.t
Modified: branches/upstream/libsearch-xapian-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Changes?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Changes (original)
+++ branches/upstream/libsearch-xapian-perl/current/Changes Tue Aug 24 12:46:57 2010
@@ -1,4 +1,11 @@
Revision history for Perl extension Search::Xapian.
+
+1.2.3.0 Tue Aug 24 06:03:12 UTC 2010
+ [Changes contributed by Tim Brody]
+ - Allow user-specified ExpandDecider to be specified to get_eset().
+ [Changes contributed by Jess Robinson]
+ - Fix bogus "can't find libtool" error when rerunning Makefile.PL and
+ XAPIAN_CONFIG isn't explicitly specified.
1.2.2.0 Sun Jun 27 03:31:36 UTC 2010
- No change except for bumping the version to indicate compatibility
Modified: branches/upstream/libsearch-xapian-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/META.yml?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/META.yml (original)
+++ branches/upstream/libsearch-xapian-perl/current/META.yml Tue Aug 24 12:46:57 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Search-Xapian
-version: 1.2.2.0
+version: 1.2.3.0
abstract: Perl XS frontend to the Xapian C++ search library.
license: ~
author:
Modified: branches/upstream/libsearch-xapian-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Makefile.PL?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Makefile.PL (original)
+++ branches/upstream/libsearch-xapian-perl/current/Makefile.PL Tue Aug 24 12:46:57 2010
@@ -80,7 +80,7 @@
my $libs = `$xapian_config --libs 2> /dev/null`;
chomp($libs);
my ($xapian_config_dir) = $xapian_config =~ /^(.*?)[^\/]*$/;
-if ($? || -f "${xapian_config_dir}Makefile") {
+if ($? || ($xapian_config_dir ne '' && -f "${xapian_config_dir}Makefile")) {
# Assume we're being asked to build against an uninstalled xapian-core.
my $libtool = "${xapian_config_dir}libtool";
unless (-x $libtool) {
Modified: branches/upstream/libsearch-xapian-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/README?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/README (original)
+++ branches/upstream/libsearch-xapian-perl/current/README Tue Aug 24 12:46:57 2010
@@ -1,4 +1,4 @@
-Search::Xapian version 1.2.2.0
+Search::Xapian version 1.2.3.0
==============================
This is Search::Xapian, a Perl XS frontend to the Xapian C++ search library.
Modified: branches/upstream/libsearch-xapian-perl/current/XS/Enquire.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/XS/Enquire.xs?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/XS/Enquire.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/XS/Enquire.xs Tue Aug 24 12:46:57 2010
@@ -234,12 +234,26 @@
RETVAL
ESet *
-Enquire::get_eset(maxitems, rset)
+Enquire::get_eset(maxitems, rset, func = NO_INIT)
doccount maxitems
RSet * rset
- CODE:
- try {
- RETVAL = new ESet(THIS->get_eset(maxitems, *rset));
+ SV * func
+ CODE:
+ try {
+ ESet eset;
+ switch (items) { /* items includes the hidden this pointer */
+ case 3:
+ eset = THIS->get_eset(maxitems, *rset);
+ break;
+ case 4: {
+ perlExpandDecider d(func);
+ eset = THIS->get_eset(maxitems, *rset, &d);
+ break;
+ }
+ default:
+ croak("Bad parameter count for get_eset");
+ }
+ RETVAL = new ESet(eset);
} catch (...) {
handle_exception();
}
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian.pm?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.pm Tue Aug 24 12:46:57 2010
@@ -4,7 +4,7 @@
use strict;
use warnings;
-our $VERSION = '1.2.2.0';
+our $VERSION = '1.2.3.0';
use Exporter 'import';
@@ -432,7 +432,8 @@
=item Unwrapped classes
The following Xapian classes are not yet wrapped:
-Error (and subclasses), ErrorHandler, ExpandDecider (and subclasses),
+Error (and subclasses), ErrorHandler, standard ExpandDecider subclasses
+(user-defined ones works),
user-defined weight classes.
We don't yet wrap Xapian::Query::MatchAll, Xapian::Query::MatchNothing,
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian.xs?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.xs Tue Aug 24 12:46:57 2010
@@ -91,6 +91,47 @@
Document *pdoc = new Document(doc);
sv_setref_pv(arg, "Search::Xapian::Document", (void *)pdoc);
XPUSHs(arg);
+
+ PUTBACK;
+
+ int count = call_sv(callback, G_SCALAR);
+
+ SPAGAIN;
+ if (count != 1)
+ croak("callback function should return 1 value, got %d", count);
+
+ int decide_actual_result = POPi;
+
+ PUTBACK;
+
+ FREETMPS;
+ LEAVE;
+
+ return decide_actual_result;
+ }
+};
+
+class perlExpandDecider : public Xapian::ExpandDecider {
+ SV *callback;
+
+ public:
+ perlExpandDecider(SV *func) {
+ callback = newSVsv(func);
+ }
+
+ ~perlExpandDecider() {
+ SvREFCNT_dec(callback);
+ }
+
+ bool operator()(const string &term) const {
+ dSP;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+
+ XPUSHs(sv_2mortal(newSVpv(term.data(), term.size())));
PUTBACK;
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian/Enquire.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian/Enquire.pm?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian/Enquire.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian/Enquire.pm Tue Aug 24 12:46:57 2010
@@ -242,7 +242,7 @@
Get match set.
-=item get_eset
+=item get_eset <maxitems> <rset> [<decider>]
Get set of query expansion terms.
Modified: branches/upstream/libsearch-xapian-perl/current/t/search.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/t/search.t?rev=61965&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/search.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/search.t Tue Aug 24 12:46:57 2010
@@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More;
-BEGIN { plan tests => 115 };
+BEGIN { plan tests => 117 };
use Search::Xapian qw(:ops);
#########################
@@ -131,6 +131,8 @@
is( ++$eit, $eset->end(), "eset iterator reaches ESet::end() ok" );
--$eit;
is( $eit->get_termname(), 'one', "eset iterator decrement works ok" );
+ok( $eset = $enq->get_eset( 10, $rset, sub { $_[0] ne "one" } ), "expanded terms set with decider" );
+is( $eset->size(), 0, "expanded terms decider filtered" );
# try an empty mset - this was giving begin != end
my ($noquery, $nomatches);
More information about the Pkg-perl-cvs-commits
mailing list