r8036 - in /branches/upstream/libsearch-xapian-perl/current: Changes MANIFEST.SKIP META.yml Makefile.PL README XS/BoolWeight.xs XS/Database.xs XS/WritableDatabase.xs Xapian.pm Xapian.xs Xapian/QueryParser.pm t/index.t t/parser.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Mon Oct 1 14:34:58 UTC 2007


Author: gregoa-guest
Date: Mon Oct  1 14:34:58 2007
New Revision: 8036

URL: http://svn.debian.org/wsvn/?sc=1&rev=8036
Log:
[svn-upgrade] Integrating new upstream version, libsearch-xapian-perl (1.0.3.0)

Modified:
    branches/upstream/libsearch-xapian-perl/current/Changes
    branches/upstream/libsearch-xapian-perl/current/MANIFEST.SKIP
    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/BoolWeight.xs
    branches/upstream/libsearch-xapian-perl/current/XS/Database.xs
    branches/upstream/libsearch-xapian-perl/current/XS/WritableDatabase.xs
    branches/upstream/libsearch-xapian-perl/current/Xapian.pm
    branches/upstream/libsearch-xapian-perl/current/Xapian.xs
    branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm
    branches/upstream/libsearch-xapian-perl/current/t/index.t
    branches/upstream/libsearch-xapian-perl/current/t/parser.t

Modified: branches/upstream/libsearch-xapian-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/Changes?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Changes (original)
+++ branches/upstream/libsearch-xapian-perl/current/Changes Mon Oct  1 14:34:58 2007
@@ -1,4 +1,18 @@
 Revision history for Perl extension Search::Xapian.
+
+1.0.3.0  Sat Sep 29 13:26:32 BST 2007
+	[Changes contributed by Olly Betts]
+	- Wrap Database::get_metadata() and WritableDatabase::set_metadata().
+	- Improve QueryParser pod documentation.
+	- PerlStopper::operator() now declared const as it should be.
+	- Suppress "deprecated" warnings from Xapian since we need to keep
+	  wrapping deprecated features.
+	- Suppress compilation warnings on some Linux distros.
+	- Add Xapian.lo to MANIFEST.SKIP (it's generated if we're building
+	  against an uninstalled xapian-core tree).
+	[Changes contributed by Reini Urban]
+	- Force LD to be "g++ -shared" for GCC on Cygwin since Perl < 5.9.5
+	  Cygwin packages need it.
 
 1.0.2.0  Thu Jul 05 15:44:03 BST 2007
 	[Changes contributed by Olly Betts]

Modified: branches/upstream/libsearch-xapian-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/MANIFEST.SKIP?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libsearch-xapian-perl/current/MANIFEST.SKIP Mon Oct  1 14:34:58 2007
@@ -11,5 +11,6 @@
 .*\.o
 Xapian.c
 Xapian.bs
+Xapian.lo
 Search-Xapian-[0-9.]*.tar.gz
 Search-Xapian-[0-9.]*

Modified: branches/upstream/libsearch-xapian-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/META.yml?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/META.yml (original)
+++ branches/upstream/libsearch-xapian-perl/current/META.yml Mon Oct  1 14:34:58 2007
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Search-Xapian
-version:      1.0.2.0
+version:      1.0.3.0
 version_from: Xapian.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libsearch-xapian-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/Makefile.PL?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Makefile.PL (original)
+++ branches/upstream/libsearch-xapian-perl/current/Makefile.PL Mon Oct  1 14:34:58 2007
@@ -1,8 +1,16 @@
 use ExtUtils::MakeMaker;
 use strict;
+use Config;
 
 my $CC = $ENV{"CXX"} || 'g++';
 my $LD = '$(CC)';
+if ($^O eq 'cygwin' and $CC eq 'g++') {
+    # Cygwin packages of Perl < 5.9.5 used "ld2" for $Config{ld} and
+    # $Config{lddlflags} didn't contain -shared so we need to specify
+    # this explicitly.  Perl >= 5.9.5 package do away with "ld2", but
+    # it should be harmless to specify "-shared" there.
+    $LD = 'g++ -shared';
+}
 
 my $xapian_config = $ENV{XAPIAN_CONFIG} || 'xapian-config';
 
@@ -13,7 +21,7 @@
 chomp($xver);
 $xver =~ s/.*\s//; # "xapian 0.9.3" -> "0.9.3"
 
-my $inc  = `$xapian_config --cxxflags`;
+my $inc = `$xapian_config --cxxflags`;
 chomp($inc);
 
 my $libsvar = 'LIBS';
@@ -38,6 +46,15 @@
     $CC = "$libtool --mode=compile $CC";
 }
 
+# Filter out some gcc options which g++ doesn't support.
+my $CCFLAGS = $Config{'ccflags'};
+# Perl is built with -Wdeclaration-after-statement on RHEL5 - this isn't
+# meaningful for C++ - it only emits a warning but it's easy to fix.
+$CCFLAGS =~ s/(?:^|\s+)-Wdeclaration-after-statement(?:\s+|$)/ /;
+# The generated code causes "variable may be used uninitialized" warnings
+# if Perl was built with -Wall.
+$CCFLAGS =~ s/(^|\s+)-Wall(\s+|$)/$1-Wall -Wno-uninitialized$2/;
+
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
 WriteMakefile(
@@ -51,11 +68,9 @@
     $libsvar		=> $libs, # e.g., '-lm'
     'DEFINE'		=> '', # e.g., '-DHAVE_SOMETHING'
     'CC'                => $CC,
+    'CCFLAGS'		=> $CCFLAGS,
     'LD'                => $LD,
-	# Insert -I. if you add *.h files later:
     'INC'		=> $inc, # e.g., '-I/usr/include/other'
-	# Un-comment this if you add C files to link with later:
-    # 'OBJECT'		=> '$(O_FILES)', # link all the C files too
     'XSOPT'             => '-C++',
     'TYPEMAPS'          => ['perlobject.map','typemap'],
     # Add "make check" as alias for "make test".

Modified: branches/upstream/libsearch-xapian-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/README?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/README (original)
+++ branches/upstream/libsearch-xapian-perl/current/README Mon Oct  1 14:34:58 2007
@@ -1,4 +1,4 @@
-Search/Xapian version 1.0.2.0
+Search/Xapian version 1.0.3.0
 =============================
 
 This is Search::Xapian, a Perl XS frontend to the Xapian C++ search 

Modified: branches/upstream/libsearch-xapian-perl/current/XS/BoolWeight.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/XS/BoolWeight.xs?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/XS/BoolWeight.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/XS/BoolWeight.xs Mon Oct  1 14:34:58 2007
@@ -5,9 +5,13 @@
 BoolWeight *
 BoolWeight::new()
     CODE:
-        RETVAL = new BoolWeight();
+	// CLASS isn't used because the typemap for O_WEIGHT means that
+	// the object is blessed as Search::Xapian::Weight, so cast to
+	// void to avoid "unused variable" warning.
+	(void)CLASS;
+	RETVAL = new BoolWeight();
     OUTPUT:
-        RETVAL
+	RETVAL
 
 void
 BoolWeight::DESTROY()

Modified: branches/upstream/libsearch-xapian-perl/current/XS/Database.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/XS/Database.xs?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/XS/Database.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/XS/Database.xs Mon Oct  1 14:34:58 2007
@@ -277,5 +277,8 @@
     OUTPUT:
         RETVAL
 
+string
+Database::get_metadata(string key)
+
 void
 Database::DESTROY()

Modified: branches/upstream/libsearch-xapian-perl/current/XS/WritableDatabase.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/XS/WritableDatabase.xs?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/XS/WritableDatabase.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/XS/WritableDatabase.xs Mon Oct  1 14:34:58 2007
@@ -378,4 +378,13 @@
         RETVAL
 
 void
+WritableDatabase::set_metadata(string key, string value)
+    CODE:
+	try {
+	    THIS->set_metadata(key, value);
+	} catch (const Error &error) {
+	    croak( "Exception: %s", error.get_msg().c_str() );
+	}
+
+void
 WritableDatabase::DESTROY()

Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/Xapian.pm?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.pm Mon Oct  1 14:34:58 2007
@@ -91,7 +91,7 @@
 our @EXPORT = qw( );
 
 
-our $VERSION = '1.0.2.0';
+our $VERSION = '1.0.3.0';
 
 bootstrap Search::Xapian $VERSION;
 
@@ -148,18 +148,12 @@
 
 This module wraps most methods of most Xapian classes. The missing classes
 and methods should be added in the future. It also provides a simplified,
-more 'perlish' interface - as demonstrated above.
-
-The Xapian library is evolving very quickly at the time of writing,
-hence any documentation placed here would be likely to become out of
-date quite rapidly, and I do not have the patience to write some which
-could rapidly become redundant.
-
-Apologies to those of you considering using this module. For the time
-being, I would suggest garnering what you can from the tests and
-examples provided, or reading through the Xapian documentation on
-L<http://www.xapian.org/>, notably the API documentation at
-L<http://www.xapian.org/docs/apidoc/html/annotated.html>.
+more 'perlish' interface to some common operations, as demonstrated above.
+
+There are some gaps in the POD documentation for wrapped classes, but you
+can read the Xapian C++ API documentation at
+L<http://www.xapian.org/docs/apidoc/html/annotated.html> for details of
+these.  Alternatively, take a look at the code in the examples and tests.
 
 If you encounter problems, email either me or preferably the
 Xapian-discuss mailing list (which I am on - subscription details can
@@ -351,7 +345,6 @@
 
 The following methods are not yet wrapped:
 Enquire::get_eset(...) with more than two arguments,
-Enquire::register_match_decider(...) with one argument,
 Query ctor optional "parameter" parameter,
 Remote::open(...),
 static Stem::get_available_languages().

Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/Xapian.xs?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.xs Mon Oct  1 14:34:58 2007
@@ -1,5 +1,5 @@
 // Disable any deprecation warnings for Xapian methods/functions/classes.
-// #define XAPIAN_DEPRECATED(D) D (not currently required).
+#define XAPIAN_DEPRECATED(D) D
 #include <xapian.h>
 #include <string>
 #include <vector>
@@ -26,7 +26,7 @@
     public:
 	PerlStopper(SV * obj) { SV_stopper_ref = newRV_inc(obj); }
 	~PerlStopper() { sv_2mortal(SV_stopper_ref); }
-	bool operator()(const string &term) {
+	bool operator()(const string &term) const {
 	    dSP ;
 
 	    ENTER ;

Modified: branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm Mon Oct  1 14:34:58 2007
@@ -35,7 +35,7 @@
 sub new() {
   my $class = shift;
   my $qp = new0();
-  
+
   bless $qp, $class;
   $qp->set_database(@_) if scalar(@_) == 1;
 
@@ -65,8 +65,8 @@
   $qp->set_stemmer(new Search::Xapian::Stem("english"));
   $qp->set_default_op(OP_AND);
 
-  $database->enquire($qp->parse_query('a word OR two NEAR "a phrase" NOT (too difficult) +eh'));
- 
+  $database->enquire($qp->parse_query('a NEAR word OR "a phrase" NOT (too difficult) +eh'));
+
 =head1 METHODS
 
 =over 4
@@ -81,7 +81,8 @@
 
 =item set_stemming_strategy <strategy>
 
-Set the stemming strategy.  Valid values are STEM_ALL, STEM_SOME, STEM_NONE.
+Set the stemming strategy.  Valid values are C<STEM_ALL>, C<STEM_SOME>,
+C<STEM_NONE>.
 
 =item set_stopper <stopper>
 
@@ -103,14 +104,15 @@
 
 =item parse_query <query_string> [<flags>]
 
-parses the query string according to the rules defined in the query parser
-documentation below. Allows you to specify certain flags to modify the
+Parses the query string according to the rules defined in the query parser
+documentation below. You can specify certain flags to modify the
 searching behaviour:
 
-  FLAG_BOOLEAN=1, FLAG_PHRASE=2, FLAG_LOVEHATE=4,
-  FLAG_BOOLEAN_ANY_CASE=8, FLAG_WILDCARD = 16
+  FLAG_BOOLEAN, FLAG_PHRASE, FLAG_LOVEHATE, FLAG_BOOLEAN_ANY_CASE,
+  FLAG_WILDCARD, FLAG_PURE_NOT, FLAG_PARTIAL
 
-default flags are FLAG_PHRASE, FLAG_BOOLEAN and FLAG_LOVEHATE
+To specify multiple flags, "or" them together (with C<|>).  The
+default flags are C<FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE>
 
 =item add_prefix <field> <prefix>
 
@@ -122,24 +124,26 @@
 other).
 
 Parameters:
-field 	The user visible field name
-prefix 	The term prefix to map this to
+field	The user visible field name
+prefix	The term prefix to map this to
 
 =item add_boolean_prefix <field> prefix
 
-Add a boolean term prefix allowing the user to restrict a search with a 
-boolean filter specified in the free text query.  E.g. 
-$p->add_boolean_prefix("site", "H");
+Add a boolean term prefix allowing the user to restrict a search with a
+boolean filter specified in the free text query.  E.g.
 
-Allows the user to restrict a search with site:xapian.org which will be 
-converted to Hxapian.org combined with any probabilistic query with OP_FILTER.
+  $p->add_boolean_prefix("site", "H");
 
-Multiple fields can be mapped to the same prefix (so you can e.g. make site: 
+Allows the user to restrict a search with site:xapian.org which will be
+converted to Hxapian.org combined with any probabilistic query with
+C<OP_FILTER>.
+
+Multiple fields can be mapped to the same prefix (so you can e.g. make site:
 and domain: aliases for each other).
 
 Parameters:
-field 	The user visible field name
-prefix 	The term prefix to map this to
+field	The user visible field name
+prefix	The term prefix to map this to
 
 =item stoplist_begin
 
@@ -151,7 +155,7 @@
 
 =item get_description
 
-Returns a string describing this object.  (for introspection)
+Returns a string describing this object.
 
 =back
 

Modified: branches/upstream/libsearch-xapian-perl/current/t/index.t
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/t/index.t?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/index.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/index.t Mon Oct  1 14:34:58 2007
@@ -6,7 +6,7 @@
 # change 'tests => 1' to 'tests => last_test_to_print';
 
 use Test::More;
-BEGIN { plan tests => 44 };
+BEGIN { plan tests => 52 };
 use Search::Xapian qw(:standard);
 
 #########################
@@ -61,6 +61,13 @@
   ok( $posit == 0 );
   $posit++;
   ok( $posit eq $database->positionlist_end(1, $term) );
+
+  # Feature test for metadata support.
+  is( $database->get_metadata( "nothing" ), "" );
+  is( $database->get_metadata( "foo" ), "" );
+  $database->set_metadata( "foo", "bar" );
+  is( $database->get_metadata( "nothing" ), "" );
+  is( $database->get_metadata( "foo" ), "bar" );
 }
 
 1;

Modified: branches/upstream/libsearch-xapian-perl/current/t/parser.t
URL: http://svn.debian.org/wsvn/branches/upstream/libsearch-xapian-perl/current/t/parser.t?rev=8036&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/parser.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/parser.t Mon Oct  1 14:34:58 2007
@@ -6,7 +6,7 @@
 
 use Test;
 use Devel::Peek;
-BEGIN { plan tests => 48 };
+BEGIN { plan tests => 51 };
 use Search::Xapian qw(:standard);
 ok(1); # If we made it this far, we're ok.
 
@@ -29,7 +29,11 @@
 $qp->set_default_op( OP_AND );
 
 my $query;
+ok( $query = $qp->parse_query( 'one or two', FLAG_BOOLEAN|FLAG_BOOLEAN_ANY_CASE ) );
+ok( $query->get_description(), "Xapian::Query((Zone:(pos=1) OR Ztwo:(pos=2)))" );
+
 ok( $query = $qp->parse_query( 'one OR (two AND three)' ) );
+ok( $query->get_description(), "Xapian::Query((Zone:(pos=1) OR (Ztwo:(pos=2) AND Zthree:(pos=3))))" );
 
 ok( my $enq = $database->enquire( $query ) );
 




More information about the Pkg-perl-cvs-commits mailing list