r26514 - in /branches/upstream/libsearch-xapian-perl/current: Changes MANIFEST META.yml Makefile.PL README Xapian.pm Xapian.xs t/01use.t t/04functions.t

ghostbar-guest at users.alioth.debian.org ghostbar-guest at users.alioth.debian.org
Sun Nov 2 07:11:23 UTC 2008


Author: ghostbar-guest
Date: Sun Nov  2 07:11:20 2008
New Revision: 26514

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

Added:
    branches/upstream/libsearch-xapian-perl/current/t/04functions.t
Modified:
    branches/upstream/libsearch-xapian-perl/current/Changes
    branches/upstream/libsearch-xapian-perl/current/MANIFEST
    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/Xapian.pm
    branches/upstream/libsearch-xapian-perl/current/Xapian.xs
    branches/upstream/libsearch-xapian-perl/current/t/01use.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=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Changes (original)
+++ branches/upstream/libsearch-xapian-perl/current/Changes Sun Nov  2 07:11:20 2008
@@ -1,4 +1,10 @@
 Revision history for Perl extension Search::Xapian.
+
+1.0.9.0  Fri Oct 31 23:27:06 GMT 2008
+	[Changes contributed by Olly Betts]
+	- Wrap Search::Xapian::get_major_version(), get_minor_version(),
+	  get_revision(), sortable_serialise(), and sortable_unserialise().
+	- Reject xapian-core < 1.0 with an error rather than just a warning.
 
 1.0.8.0  Thu Sep  4 05:38:22 GMT 2008
 	- No change except for bumping the version to indicate compatibility

Modified: branches/upstream/libsearch-xapian-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/MANIFEST?rev=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/MANIFEST (original)
+++ branches/upstream/libsearch-xapian-perl/current/MANIFEST Sun Nov  2 07:11:20 2008
@@ -70,6 +70,7 @@
 t/01use.t
 t/02pod.t
 t/03podcoverage.t
+t/04functions.t
 t/create.t
 t/document.t
 t/exception.t

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=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/META.yml (original)
+++ branches/upstream/libsearch-xapian-perl/current/META.yml Sun Nov  2 07:11:20 2008
@@ -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.8.0
+version:      1.0.9.0
 version_from: Xapian.pm
 installdirs:  site
 requires:

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=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Makefile.PL (original)
+++ branches/upstream/libsearch-xapian-perl/current/Makefile.PL Sun Nov  2 07:11:20 2008
@@ -127,7 +127,15 @@
 
 my ($BASEVERSION) = $VERSION =~ /^([0-9]+\.[0-9]+\.[0-9]+)/;
 if ($xver !~ /^\Q$BASEVERSION\E(?:_svn[0-9]+)?$/) {
-    my $msg = "Xapian version $xver may be incompatible with Search::Xapian $VERSION\n";
+    # There's no chance that we'll with xapian-core 0.x.y.
+    my $no_chance = ($xver =~ /^0/);
+    my $msg;
+    if ($no_chance) {
+	$msg = "Xapian version $xver is incompatible with Search::Xapian $VERSION\n";
+    } else {
+	$msg = "Xapian version $xver may be incompatible with Search::Xapian $VERSION\n";
+    }
+
     if ($ENV{AUTOMATED_TESTING}) {
 	# Don't let automated testers continue, as we don't want bogus failure
 	# reports due to builds with incompatible versions.
@@ -137,6 +145,10 @@
 	# by CPAN test building scripts.
 	unlink "Makefile";
 	exit 0;
+    }
+    if ($no_chance) {
+	unlink "Makefile";
+	die $msg;
     }
     warn "Warning: $msg";
 }

Modified: branches/upstream/libsearch-xapian-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/README?rev=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/README (original)
+++ branches/upstream/libsearch-xapian-perl/current/README Sun Nov  2 07:11:20 2008
@@ -1,4 +1,4 @@
-Search::Xapian version 1.0.8.0
+Search::Xapian version 1.0.9.0
 ==============================
 
 This is Search::Xapian, a Perl XS frontend to the Xapian C++ search library.

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=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.pm Sun Nov  2 07:11:20 2008
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.0.8.0';
+our $VERSION = '1.0.9.0';
 
 use Exporter 'import';
 
@@ -341,6 +341,76 @@
 
 Standard is db + ops + qpflags + qpstem
 
+=head1 Version functions
+
+=over 4
+
+=item major_version
+
+Returns the major version of the Xapian C++ library being used.  E.g. for
+Xapian 1.0.9 this would return 1.
+
+=item minor_version
+
+Returns the minor version of the Xapian C++ library being used.  E.g. for
+Xapian 1.0.9 this would return 0.
+
+=item revision
+
+Returns the revision of the Xapian C++ library being used.  E.g. for
+Xapian 1.0.9 this would return 9.  In a stable release series, Xapian libraries
+with the same minor and major versions are usually ABI compatible, so this
+often won't match the third component of $Search::Xapian::VERSION (which is the
+version of the Search::Xapian XS wrappers).
+
+=back
+
+=head1 Numeric encoding functions
+
+=over 4
+
+=item sortable_serialise NUMBER
+
+Convert a floating point number to a string, preserving sort order.
+
+This method converts a floating point number to a string, suitable for
+using as a value for numeric range restriction, or for use as a sort
+key.
+
+The conversion is platform independent.
+
+The conversion attempts to ensure that, for any pair of values supplied
+to the conversion algorithm, the result of comparing the original
+values (with a numeric comparison operator) will be the same as the
+result of comparing the resulting values (with a string comparison
+operator).  On platforms which represent doubles with the precisions
+specified by IEEE_754, this will be the case: if the representation of
+doubles is more precise, it is possible that two very close doubles
+will be mapped to the same string, so will compare equal.
+
+Note also that both zero and -zero will be converted to the same
+representation: since these compare equal, this satisfies the
+comparison constraint, but it's worth knowing this if you wish to use
+the encoding in some situation where this distinction matters.
+
+Handling of NaN isn't (currently) guaranteed to be sensible.
+
+=item sortable_unserialise SERIALISED_NUMBER
+
+Convert a string encoded using sortable_serialise back to a floating
+point number.
+
+This expects the input to be a string produced by sortable_serialise().
+If the input is not such a string, the value returned is undefined (but
+no error will be thrown).
+
+The result of the conversion will be exactly the value which was
+supplied to sortable_serialise() when making the string on platforms
+which represent doubles with the precisions specified by IEEE_754, but
+may be a different (nearby) value on other platforms.
+
+=back
+
 =head1 TODO
 
 =over 4

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=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.xs Sun Nov  2 07:11:20 2008
@@ -112,6 +112,23 @@
 
 PROTOTYPES: ENABLE
 
+string
+sortable_serialise(double value)
+
+double
+sortable_unserialise(string value)
+
+const char *
+version_string()
+
+int
+major_version()
+
+int
+minor_version()
+
+int
+revision()
 
 INCLUDE: XS/BM25Weight.xs
 INCLUDE: XS/BoolWeight.xs

Modified: branches/upstream/libsearch-xapian-perl/current/t/01use.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/t/01use.t?rev=26514&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/01use.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/01use.t Sun Nov  2 07:11:20 2008
@@ -1,3 +1,7 @@
-use Test::More tests => 1;
+use Test::More tests => 3;
 
 use_ok('Search::Xapian');
+
+# Check that module's version is defined and has a sane value.
+ok(defined($Search::Xapian::VERSION));
+ok($Search::Xapian::VERSION =~ /^\d+\.\d+\.\d+\.\d+$/);

Added: branches/upstream/libsearch-xapian-perl/current/t/04functions.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/t/04functions.t?rev=26514&op=file
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/04functions.t (added)
+++ branches/upstream/libsearch-xapian-perl/current/t/04functions.t Sun Nov  2 07:11:20 2008
@@ -1,0 +1,31 @@
+
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+use Test::More;
+BEGIN { plan tests => 14 };
+use Search::Xapian qw(:standard);
+
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Test non-class functions.
+
+my $version = join(".", (
+	Search::Xapian::major_version(),
+	Search::Xapian::minor_version(),
+	Search::Xapian::revision()
+    ));
+
+ok($version eq Search::Xapian::version_string());
+
+for my $val (-9e10, -1234.56, -1, -1e-10, 0, 1e-10, 1, 2, 4, 8, 9, 9e10) {
+    my $enc_val = Search::Xapian::sortable_serialise($val);
+    ok(Search::Xapian::sortable_unserialise($enc_val) == $val);
+}
+
+
+1;




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