r6990 - in /branches/upstream/libnet-z3950-zoom-perl/current: ./ lib/ lib/Net/ lib/Net/Z3950/ samples/zoom/ t/

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Mon Aug 20 08:55:59 UTC 2007


Author: dmn
Date: Mon Aug 20 08:55:59 2007
New Revision: 6990

URL: http://svn.debian.org/wsvn/?sc=1&rev=6990
Log:
[svn-upgrade] Integrating new upstream version, libnet-z3950-zoom-perl (1.19)

Added:
    branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl   (with props)
Modified:
    branches/upstream/libnet-z3950-zoom-perl/current/Changes
    branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST
    branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP
    branches/upstream/libnet-z3950-zoom-perl/current/META.yml
    branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL
    branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs
    branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950.pm
    branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm
    branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm
    branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod
    branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zselect
    branches/upstream/libnet-z3950-zoom-perl/current/t/19-events.t
    branches/upstream/libnet-z3950-zoom-perl/current/t/27-logging.t

Modified: branches/upstream/libnet-z3950-zoom-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/Changes?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Changes (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Changes Mon Aug 20 08:55:59 2007
@@ -1,6 +1,40 @@
-$Id: Changes,v 1.54 2007/01/16 11:17:48 mike Exp $
+$Id: Changes,v 1.63 2007/07/09 13:09:46 mike Exp $
 
 Revision history for Perl extension Net::Z3950::ZOOM.
+
+1.19  Mon Jul  9 14:09:31 BST 2007
+	- Add $conn->exception() method.
+	- Set version number for Net::Z3950 to 0.99 -- less than the
+	  1.0 version number that will be used when it successfully
+	  emulates the old Net::Z3950 module, but superseding the last
+	  release, 0.51, of that module.
+	- Include samples/zoom/zdump.pl in distribution.
+	- Add "irspy" namespace to samples/zoom/zselect
+
+1.18  Mon Feb 26 14:57:48 GMT 2007
+	- When a connection is in asynchronous mode, failing
+	  operations (search, scan, etc.) no longer throw exceptions.
+	  This is because the event-loop in asychronous applications
+	  needs to check for errors anyway, in case the server has
+	  returned high-level diagnostics such as "unsupported use
+	  attribute".  So this check within the event-loop is now the
+	  only place where error-checking need be done.
+	- Add new public ZOOM::Connection() function, check(), which
+	  throws an exception if an error is pending (even if the
+	  connection is asynchronous).
+	- New YAZ logging level, "zoom_check", notes when errors are
+	  detected and either left unreported (asynchronous
+	  connections) or thrown as exception (synchronous).
+
+1.17  Thu Feb 22 20:38:45 GMT 2007
+	- Change Net::Z3950::ZOOM::event() to allocate its array of
+	  connection pointers dynamically, so there is no longer an
+	  arbitrary limit of 100.
+	- New connection-level option "_check_debug" emits messages on
+	  standard error when checking a connection find an error that
+	  is about to result in throwing an exception.  There is no
+	  reason for you ever to use this, though -- pretend you don't
+	  know about it.
 
 1.16  Tue Jan 16 11:18:34 GMT 2007
 	- Require version 2.1.41 or better of YAZ, so that Init
@@ -10,7 +44,6 @@
 	- Add ZOOM_connection_peek_event() and $conn->peek_event().
 	- Require YAZ version 2.1.45, which is the first to provide
 	  ZOOM_connection_peek_event().
-
 
 1.15  Fri Dec  1 14:17:49 GMT 2006
 	- ZOOM::Error::INIT is renamed to ZOOM::Error::ZINIT, since

Modified: branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: MANIFEST,v 1.32 2006/12/06 11:18:33 mike Exp $
+# $Id: MANIFEST,v 1.33 2007/03/07 16:17:28 mike Exp $
 
 Changes
 Makefile.PL
@@ -49,3 +49,4 @@
 samples/zoom/update.pl
 samples/zoom/zselect
 samples/zoom/zhello.pl
+samples/zoom/zdump.pl

Modified: branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP Mon Aug 20 08:55:59 2007
@@ -1,8 +1,8 @@
-# $Id: MANIFEST.SKIP,v 1.3 2005/10/26 16:30:39 mike Exp $
+# $Id: MANIFEST.SKIP,v 1.4 2007/07/09 13:03:00 mike Exp $
 
 .cvsignore
 CVS
-fish
+debian
 lib/CVS
 t/CVS
 archive

Modified: branches/upstream/libnet-z3950-zoom-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/META.yml?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/META.yml (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/META.yml Mon Aug 20 08:55:59 2007
@@ -1,11 +1,11 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Net-Z3950-ZOOM
-version:      1.16
+version:      1.19
 version_from: lib/Net/Z3950/ZOOM.pm
 installdirs:  site
 requires:
     MARC::Record:                  1.38
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30_01

Modified: branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL,v 1.18 2007/01/16 11:16:57 mike Exp $
+# $Id: Makefile.PL,v 1.20 2007/02/26 14:41:24 mike Exp $
 
 use 5.008;
 use ExtUtils::MakeMaker;
@@ -16,7 +16,7 @@
 }
 
 chomp($yazver);
-check_version($yazver, "2.1.45");
+check_version($yazver, "2.1.50");
 
 # For Windows use
 # $yazinc = '-Ic:\yaz\include'
@@ -52,7 +52,7 @@
 	($gmajor == $wmajor && $gminor < $wminor) ||
 	($gmajor == $wmajor && $gminor == $wminor && $gtrivial < $wtrivial)) {
 	print <<__EOT__;
-*** WARNING!
+*** ERROR!
 ZOOM-Perl requires at least version $want of YAZ,
 but is currently you only have version $got.
 __EOT__

Modified: branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-/* $Id: ZOOM.xs,v 1.46 2007/01/16 11:17:15 mike Exp $ */
+/* $Id: ZOOM.xs,v 1.47 2007/02/22 20:37:47 mike Exp $ */
 
 #include "EXTERN.h"
 #include "perl.h"
@@ -554,7 +554,7 @@
 		SV *realconns;
 		I32 n, i;
 		int res;
-		ZOOM_connection cs[100];
+		ZOOM_connection *cs;
 	CODE:
 		/*printf("* in ZOOM_event(%p)\n", conns);*/
 		if (!SvROK(conns)) {
@@ -572,12 +572,14 @@
 		if (n == 0) {
 			/*printf("* No connections in referenced array\n");*/
 			XSRETURN_IV(-3);
-		} else if (n >= sizeof(cs)/sizeof(cs[0])) {
+		}
+
+		/*printf("* n = %d\n", n);*/
+		if ((cs = (ZOOM_connection*) malloc(n * sizeof *cs)) == 0) {
 			/*printf("* Too many connections (%d)\n", (int) n);*/
 			XSRETURN_IV(-4);
 		}
 
-		/*printf("* n = %d\n", n);*/
 		for (i = 0; i < n; i++) {
 		    SV **connp = av_fetch((AV*) realconns, i, (I32) 0);
 		    SV *conn, *sv;
@@ -603,6 +605,7 @@
 		    /*printf("got cs[%d] of %d = %p\n", (int) i, (int) n, cs[i]);*/
 		}
 		RETVAL = ZOOM_event((int) n, cs);
+		free(cs);
 	OUTPUT:
 		RETVAL
 

Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950.pm?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950.pm Mon Aug 20 08:55:59 2007
@@ -1,8 +1,10 @@
-# $Id: Z3950.pm,v 1.1 2005/10/13 13:11:17 mike Exp $
+# $Id: Z3950.pm,v 1.2 2007/02/26 15:58:33 mike Exp $
 
 use strict;
 use warnings;
 use Net::Z3950::ZOOM;
+
+our $VERSION = '0.99';	# Supersedes "proper" Net::Z3950 v0.51
 
 
 # Member naming convention is the same as in ../ZOOM.pm

Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.31 2006/12/06 11:18:33 mike Exp $
+# $Id: ZOOM.pm,v 1.34 2007/02/26 15:58:57 mike Exp $
 
 package Net::Z3950::ZOOM; 
 
@@ -6,17 +6,17 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.16';
+our $VERSION = '1.19';
 
 require XSLoader;
 XSLoader::load('Net::Z3950::ZOOM', $VERSION);
 
 my($vs, $ss) = ("x" x 100, "x" x 100); # allocate space for these strings
 my $version = Net::Z3950::ZOOM::yaz_version($vs, $ss);
-if ($version < 0x020115 && ! -f "/tmp/ignore-ZOOM-YAZ-version-mismatch") {
+if ($version < 0x020132 && ! -f "/tmp/ignore-ZOOM-YAZ-version-mismatch") {
     warn <<__EOT__;
 *** WARNING!
-ZOOM-Perl requires at least version 2.1.21 of YAZ, but is currently
+ZOOM-Perl requires at least version 2.1.50 of YAZ, but is currently
 running against only version $vs (sys-string '$ss').
 Some things may not work.
 __EOT__

Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.44 2007/01/16 11:17:28 mike Exp $
+# $Id: ZOOM.pm,v 1.48 2007/05/09 12:03:52 mike Exp $
 
 use strict;
 use warnings;
@@ -337,12 +337,32 @@
 
 sub _check {
     my $this = shift();
+    my($always_die_on_error) = @_;
 
     my($errcode, $errmsg, $addinfo, $diagset) = (undef, "x", "x", "x");
     $errcode = Net::Z3950::ZOOM::connection_error_x($this->_conn(), $errmsg,
 						    $addinfo, $diagset);
-    die new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset)
-	if $errcode;
+    if ($errcode) {
+	my $exception = new ZOOM::Exception($errcode, $errmsg, $addinfo,
+					    $diagset);
+	if (!$this->option("async") || $always_die_on_error) {
+	    ZOOM::Log::log("zoom_check", "throwing error $exception");
+	    die $exception;
+	} else {
+	    ZOOM::Log::log("zoom_check", "not reporting error $exception");
+	}
+    }
+}
+
+# This wrapper for _check() is called only from outside the ZOOM
+# module, and therefore only in situations where an asynchronous
+# application is actively asking for an exception to be thrown if an
+# error has been detected.  So it passed always_die_on_error=1 to the
+# underlying _check() method.
+#
+sub check {
+    my $this = shift();
+    return $this->_check(1);
 }
 
 sub create {
@@ -380,6 +400,14 @@
     $errcode = Net::Z3950::ZOOM::connection_error_x($this->_conn(), $errmsg,
 						    $addinfo, $diagset);
     return wantarray() ? ($errcode, $errmsg, $addinfo, $diagset) : $errcode;
+}
+
+sub exception {
+    my $this = shift();
+
+    my($errcode, $errmsg, $addinfo, $diagset) = $this->error_x();
+    return undef if $errcode == 0;
+    return new ZOOM::Exception($errcode, $errmsg, $addinfo, $diagset);
 }
 
 sub errcode {
@@ -1074,5 +1102,6 @@
     Net::Z3950::ZOOM::yaz_log($level, join("", @message));
 }
 
+BEGIN { ZOOM::Log::mask_str("zoom_check"); }
 
 1;

Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pod,v 1.41 2006/12/01 14:11:21 mike Exp $
+# $Id: ZOOM.pod,v 1.43 2007/05/09 12:03:52 mike Exp $
 
 use strict;
 use warnings;
@@ -304,6 +304,24 @@
 returns all four at once.
 
 See the C<ZOOM::Exception> for the interpretation of these elements.
+
+=head4 exception()
+
+ die $conn->exception();
+
+C<exception()> returns the same information as C<error_x()> in the
+form of a C<ZOOM::Exception> object which may be thrown or rendered.
+If no error occurred on the connection, then C<exception()> returns an
+undefined value.
+
+=head4 check()
+
+ $conn->check();
+
+Checks whether an error is pending on the connection, and throw a
+C<ZOOM::Exception> object if so.  Since errors are thrown as they
+occur for synchronous connections, there is no need ever to call this
+except in asynchronous applications.
 
 =head4 option() / option_binary()
 

Added: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl?rev=6990&op=file
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl (added)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl Mon Aug 20 08:55:59 2007
@@ -1,0 +1,33 @@
+#!/usr/bin/perl -w
+
+# $Id$
+#
+# Dumps the contents of the nominated Zebra database to a set of
+# separate XML files with numeric names.
+
+use strict;
+use warnings;
+use ZOOM;
+
+if (@ARGV != 1) {
+    print STDERR "Usage: $0 target\n";
+    exit 1;
+}
+
+my $conn = new ZOOM::Connection($ARGV[0]);
+$conn->option(preferredRecordSyntax => "xml");
+$conn->option(elementSetName => "zebra::data");
+my $rs = $conn->search_pqf('@attr 1=_ALLRECORDS @attr 2=103 ""');
+my $n = $rs->size();
+$| = 1;
+print "$0: dumping $n records\n";
+foreach my $i (1..$n) {
+    print ".";
+    print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0;
+    my $rec = $rs->record($i-1);
+    my $xml = $rec->render();
+    open F, ">$i.xml" or die "can't open\n";
+    print F $xml;
+    close F;
+}
+print " $n/$n (100%)\n" if $n % 50 != 0;

Propchange: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zdump.pl
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zselect
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zselect?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zselect (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zselect Mon Aug 20 08:55:59 2007
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# $Id: zselect,v 1.2 2006/09/25 19:51:42 mike Exp $
+# $Id: zselect,v 1.3 2007/04/18 11:18:08 mike Exp $
 
 # Example command-line:
 #	./zselect -t q localhost:3313/IR-Explain---1 "net.port=3950" "concat(zeerex:serverInfo/zeerex:host, ':', zeerex:serverInfo/zeerex:port, '/', zeerex:serverInfo/zeerex:database)"
@@ -70,5 +70,6 @@
 sub register_namespaces {
     my($xc) = @_;
     $xc->registerNs(zeerex => 'http://explain.z3950.org/dtd/2.0/');
+    $xc->registerNs(irspy => 'http://indexdata.com/irspy/1.0');
     # More to come
 }

Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/19-events.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/19-events.t?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/19-events.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/19-events.t Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: 19-events.t,v 1.7 2006/11/02 17:48:26 mike Exp $
+# $Id: 19-events.t,v 1.8 2007/02/22 20:38:11 mike Exp $
 
 # Before `make install' is performed this script should be runnable with
 # `make test'. After `make install' it should work as `perl 19-events.t'
@@ -32,8 +32,10 @@
 $val = Net::Z3950::ZOOM::event([]);
 ok($val == -3, "empty array reference argument rejected");
 
-$val = Net::Z3950::ZOOM::event([1..32767]);
-ok($val == -4, "huge array reference argument rejected");
+# The old test for giant array reference can't be done now that the
+# corresponding array internal to the glue-code is allocated
+# dynamically.
+ok(1, "huge array reference argument rejected");
 
 # Test the sequence of events that come from just creating the
 # connection: there's the physical connect; the sending the Init

Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/27-logging.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/27-logging.t?rev=6990&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/27-logging.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/27-logging.t Mon Aug 20 08:55:59 2007
@@ -1,4 +1,4 @@
-# $Id: 27-logging.t,v 1.1 2005/12/21 16:58:36 mike Exp $
+# $Id: 27-logging.t,v 1.2 2007/02/26 14:56:26 mike Exp $
 
 # Before `make install' is performed this script should be runnable with
 # `make test'. After `make install' it should work as `perl 27-logging.t'
@@ -13,12 +13,12 @@
 check_level("none,debug", 2);
 check_level("none,warn", 4);
 check_level("none,warn,debug", 6);
-check_level("none,zoom", 8192);
+check_level("none,zoom", 16384);
 check_level("none,-warn", 0);
 check_level("", 2077);
 check_level("-warn", 2073);
-check_level("zoom", 10269);
-check_level("none,zoom,fruit", 24576);
+check_level("zoom", 18461);
+check_level("none,zoom,fruit", 49152);
 
 sub check_level {
     my($str, $expect) = @_;




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