r10944 - in /branches/upstream/libnet-z3950-zoom-perl/current: ./ lib/ lib/Net/Z3950/ samples/zoom/ t/
vdanjean at users.alioth.debian.org
vdanjean at users.alioth.debian.org
Fri Dec 7 01:39:10 UTC 2007
Author: vdanjean
Date: Fri Dec 7 01:39:10 2007
New Revision: 10944
URL: http://svn.debian.org/wsvn/?sc=1&rev=10944
Log:
[svn-upgrade] Integrating new upstream version, libnet-z3950-zoom-perl (1.21)
Added:
branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl
Modified:
branches/upstream/libnet-z3950-zoom-perl/current/Changes
branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST
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/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/zoomtst1.pl
branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t
branches/upstream/libnet-z3950-zoom-perl/current/t/15-scan.t
branches/upstream/libnet-z3950-zoom-perl/current/t/2-ZOOM.t
branches/upstream/libnet-z3950-zoom-perl/current/t/25-scan.t
branches/upstream/libnet-z3950-zoom-perl/current/typemap
Modified: branches/upstream/libnet-z3950-zoom-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/Changes?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Changes (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Changes Fri Dec 7 01:39:10 2007
@@ -1,6 +1,36 @@
-$Id: Changes,v 1.63 2007/07/09 13:09:46 mike Exp $
+$Id: Changes,v 1.71 2007-10-29 12:07:23 mike Exp $
Revision history for Perl extension Net::Z3950::ZOOM.
+
+1.21 Mon Oct 29 12:07:25 GMT 2007
+ - In the "typemap" file's handling of opaquechar*, use STRLEN
+ type for _unused_len in instead of unsigned: this prevents a
+ (possibly serious) warning on some 64-bit architectures,
+ although applications that do not use the option_binary()
+ methods will be safe with the previous release.
+ - Add explicit "#include <yaz/log.h>" to ZOOM.xs in the hope
+ of preventing undeclared-function warnings that some users
+ have reported but which I have been unable to reproduce.
+
+1.20 Fri Sep 21 17:51:55 BST 2007
+ - Add new sample program, samples/zoom/zoomscan.pl
+ - samples/zoom/zoomtst1.pl now accepts arbitrary options at
+ the end of the command-line, so that (for example) you can
+ specify a non-USMARC record syntax.
+ - Add new functions Net::Z3950::ZOOM::diag_srw_str() and
+ ZOOM::diag_srw_str() to map SRW diagnostic codes into
+ human-readable messages.
+ - ZOOM::Exception() constructor uses diag_srw_str() to fill in
+ the error message, if it is undefined, for SRW errors.
+ - The render() method of ZOOM::Exception(), and therefore the
+ overloaded stringifying operator, deals with exceptions that
+ have no message().
+ - Corrected the scan parts of the test-suite that use CQL so
+ that they explicitly perform client-side CQL compilation and
+ send the resulting Type-1 query. Previously, these tests
+ were (accidentally) requesting that CQL be sent as-is to the
+ server, but this mistake was being masked by an error in
+ older versions of ZOOM-C that compiled client-side anyway!
1.19 Mon Jul 9 14:09:31 BST 2007
- Add $conn->exception() method.
Modified: branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: MANIFEST,v 1.33 2007/03/07 16:17:28 mike Exp $
+# $Id: MANIFEST,v 1.34 2007/08/16 15:40:30 mike Exp $
Changes
Makefile.PL
@@ -42,11 +42,12 @@
samples/net-z3950-zoom/zoomtst3.pl
samples/net-z3950-zoom/async.pl
samples/net-z3950/zoomtst1.pl
-samples/zoom/zoomtst1.pl
-samples/zoom/zoomtst3.pl
samples/zoom/async.pl
samples/zoom/trivial-async.pl
samples/zoom/update.pl
+samples/zoom/zdump.pl
+samples/zoom/zhello.pl
+samples/zoom/zoomscan.pl
+samples/zoom/zoomtst1.pl
+samples/zoom/zoomtst3.pl
samples/zoom/zselect
-samples/zoom/zhello.pl
-samples/zoom/zdump.pl
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=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/META.yml (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/META.yml Fri Dec 7 01:39:10 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: Net-Z3950-ZOOM
-version: 1.19
+version: 1.21
version_from: lib/Net/Z3950/ZOOM.pm
installdirs: site
requires:
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=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL Fri Dec 7 01:39:10 2007
@@ -1,4 +1,7 @@
-# $Id: Makefile.PL,v 1.20 2007/02/26 14:41:24 mike Exp $
+# $Id: Makefile.PL,v 1.24 2007/10/03 14:05:04 mike Exp $
+
+# Use: perl Makefile.PL OPTIMIZE="-O0 -g -Wdeclaration-after-statement"
+# or: perl Makefile.PL PREFIX=/home/mike/universe
use 5.008;
use ExtUtils::MakeMaker;
@@ -54,7 +57,7 @@
print <<__EOT__;
*** ERROR!
ZOOM-Perl requires at least version $want of YAZ,
-but is currently you only have version $got.
+but you only have version $got.
__EOT__
exit 1;
}
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=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs Fri Dec 7 01:39:10 2007
@@ -1,11 +1,13 @@
-/* $Id: ZOOM.xs,v 1.47 2007/02/22 20:37:47 mike Exp $ */
+/* $Id: ZOOM.xs,v 1.49 2007-10-29 12:06:57 mike Exp $ */
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <yaz/zoom.h>
+#include <yaz/diagsrw.h>
#include <yaz/xmalloc.h>
+#include <yaz/log.h>
/* Used by the *_setl() functions */
typedef char opaquechar;
@@ -203,6 +205,14 @@
const char *
ZOOM_diag_str(error)
int error
+
+const char *
+ZOOM_diag_srw_str(error)
+ int error
+ CODE:
+ RETVAL = yaz_diag_srw_str(error);
+ OUTPUT:
+ RETVAL
ZOOM_resultset
ZOOM_connection_search(arg0, q)
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=10944&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 Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.34 2007/02/26 15:58:57 mike Exp $
+# $Id: ZOOM.pm,v 1.36 2007-10-29 11:52:39 mike Exp $
package Net::Z3950::ZOOM;
@@ -6,7 +6,7 @@
use strict;
use warnings;
-our $VERSION = '1.19';
+our $VERSION = '1.21';
require XSLoader;
XSLoader::load('Net::Z3950::ZOOM', $VERSION);
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=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.48 2007/05/09 12:03:52 mike Exp $
+# $Id: ZOOM.pm,v 1.49 2007/09/14 10:34:35 mike Exp $
use strict;
use warnings;
@@ -113,6 +113,12 @@
return Net::Z3950::ZOOM::diag_str($code);
}
+sub diag_srw_str {
+ my($code) = @_;
+
+ return Net::Z3950::ZOOM::diag_srw_str($code);
+}
+
sub event_str {
return Net::Z3950::ZOOM::event_str(@_);
}
@@ -141,8 +147,11 @@
$diagset ||= "ZOOM";
if (uc($diagset) eq "ZOOM" || uc($diagset) eq "BIB-1") {
$message ||= ZOOM::diag_str($code);
+ } elsif (lc($diagset) eq "info:srw/diagnostic/1") {
+ $message ||= ZOOM::diag_srw_str($code);
} else {
- # Should fill in messages for other diagsets, too.
+ # Should fill in messages for any other known diagsets.
+ $message ||= "(unknown error)";
}
return bless {
@@ -175,7 +184,9 @@
sub render {
my $this = shift();
- my $res = "ZOOM error " . $this->code() . ' "' . $this->message() . '"';
+
+ my $res = "ZOOM error " . $this->code();
+ $res .= ' "' . $this->message() . '"' if $this->message();
$res .= ' (addinfo: "' . $this->addinfo() . '")' if $this->addinfo();
$res .= " from diag-set '" . $this->diagset() . "'" if $this->diagset();
return $res;
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=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pod,v 1.43 2007/05/09 12:03:52 mike Exp $
+# $Id: ZOOM.pod,v 1.44 2007/09/14 10:35:02 mike Exp $
use strict;
use warnings;
@@ -97,6 +97,13 @@
C<ZOOM::Connection::errcode()>,
irrespective of whether it is a member of the C<ZOOM::Error>
enumeration or drawn from the BIB-1 diagnostic set.
+
+=head2 ZOOM::diag_srw_str()
+
+ $msg = ZOOM::diag_srw_str(18);
+
+Returns a human-readable English-language string corresponding to the
+specified SRW error code.
=head2 ZOOM::event_str()
Added: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl?rev=10944&op=file
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl (added)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl Fri Dec 7 01:39:10 2007
@@ -1,0 +1,49 @@
+#!/usr/bin/perl -w
+
+# $Id: zoomscan.pl,v 1.4 2007/08/17 18:35:17 mike Exp $
+#
+# This is the scanning counterpart to zoomscan.pl's searching
+# perl -I../../blib/lib -I../../blib/arch zoomscan.pl <target> <scanQuery>
+#
+# For example (using Z39.50 and SRW, Type-1 and CQL):
+# perl zoomscan.pl tcp:localhost:8018/IR-Explain---1 '@attr 1=dc.title the'
+# perl zoomscan.pl http://localhost:8018/IR-Explain---1 '@attr 1=dc.title the'
+# perl zoomscan.pl -q http://localhost:8018/IR-Explain---1 'dc.title=the'
+
+use strict;
+use warnings;
+use Getopt::Std;
+use ZOOM;
+
+my %opts;
+if (!getopts('q', \%opts) || @ARGV != 2) {
+ print STDERR "Usage: $0 [options] target scanQuery
+ -q Query is CQL [default: PQF]
+ eg. $0 z3950.indexdata.dk/gils computer\n";
+ exit 1;
+}
+
+my($host, $scanQuery) = @ARGV;
+
+eval {
+ my $conn = new ZOOM::Connection($host, 0);
+ $conn->option(preferredRecordSyntax => "usmarc");
+ ### Could use ZOOM::Query::CQL below, but that only work in SRU/W.
+ my $q = $opts{q} ? new ZOOM::Query::CQL($scanQuery) :
+ new ZOOM::Query::PQF($scanQuery);
+ my $ss = $conn->scan($q);
+ my $n = $ss->size();
+ for my $i (0..$n-1) {
+ my($term, $occ) = $ss->term($i);
+ print $i+1, ": $term";
+ print " ($occ)" if defined $occ;
+ print "\n";
+ }
+
+ $ss->destroy();
+ $conn->destroy();
+}; if ($@) {
+ die "Non-ZOOM error: $@" if !$@->isa("ZOOM::Exception");
+ print STDERR "ZOOM error $@\n";
+ exit 1;
+}
Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomtst1.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomtst1.pl?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomtst1.pl (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomtst1.pl Fri Dec 7 01:39:10 2007
@@ -1,4 +1,6 @@
-# $Id: zoomtst1.pl,v 1.4 2006/11/02 17:48:26 mike Exp $
+#!/usr/bin/perl -w
+
+# $Id: zoomtst1.pl,v 1.6 2007/08/17 18:35:17 mike Exp $
#
# See ../README for a description of this program.
# perl -I../../blib/lib -I../../blib/arch zoomtst1.pl <target> <query>
@@ -7,16 +9,23 @@
use warnings;
use ZOOM;
-if (@ARGV != 2) {
- print STDERR "Usage: $0 target query\n";
+if (@ARGV < 2 || @ARGV %2 == 1) {
+ print STDERR "Usage: $0 target query [<option> <value> ...]\n";
print STDERR " eg. $0 z3950.indexdata.dk/gils computer\n";
exit 1;
}
-my($host, $query) = @ARGV;
+my $host = shift(@ARGV);
+my $query = shift(@ARGV);
eval {
my $conn = new ZOOM::Connection($host, 0);
$conn->option(preferredRecordSyntax => "usmarc");
+ while (@ARGV) {
+ my $key = shift(@ARGV);
+ my $value = shift(@ARGV);
+ $conn->option($key => $value);
+ }
+
my $rs = $conn->search_pqf($query);
my $n = $rs->size();
print "Query '$query' found $n records\n";
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t Fri Dec 7 01:39:10 2007
@@ -1,15 +1,18 @@
-# $Id: 1-Net-Z3950-ZOOM.t,v 1.15 2006/11/02 17:48:26 mike Exp $
+# $Id: 1-Net-Z3950-ZOOM.t,v 1.16 2007/09/14 10:36:13 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1-Net-Z3950-ZOOM.t'
use strict;
use warnings;
-use Test::More tests => 22;
+use Test::More tests => 23;
BEGIN { use_ok('Net::Z3950::ZOOM') };
my $msg = Net::Z3950::ZOOM::diag_str(Net::Z3950::ZOOM::ERROR_INVALID_QUERY);
ok($msg eq "Invalid query", "diagnostic string lookup works");
+
+$msg = Net::Z3950::ZOOM::diag_srw_str(27);
+ok($msg eq "Empty term unsupported", "SRW diagnostic string lookup works");
my($errcode, $errmsg, $addinfo) = (undef, "dummy", "dummy");
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/15-scan.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/15-scan.t?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/15-scan.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/15-scan.t Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: 15-scan.t,v 1.13 2006/11/02 17:48:26 mike Exp $
+# $Id: 15-scan.t,v 1.14 2007/08/16 17:19:35 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 15-scan.t'
@@ -65,7 +65,7 @@
"samples/cql/pqf.properties");
$q = Net::Z3950::ZOOM::query_create();
-Net::Z3950::ZOOM::query_cql($q, 'title=w');
+Net::Z3950::ZOOM::query_cql2rpn($q, 'title=w', $conn);
($ss, $n) = scan($conn, 1, $q, 4);
# Get last term and use it as seed for next scan
my $term = Net::Z3950::ZOOM::scanset_term($ss, $n-1, $occ, $len);
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/2-ZOOM.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/2-ZOOM.t?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/2-ZOOM.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/2-ZOOM.t Fri Dec 7 01:39:10 2007
@@ -1,15 +1,18 @@
-# $Id: 2-ZOOM.t,v 1.12 2006/11/02 17:48:26 mike Exp $
+# $Id: 2-ZOOM.t,v 1.13 2007/09/14 10:36:13 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 2-ZOOM.t'
use strict;
use warnings;
-use Test::More tests => 22;
+use Test::More tests => 23;
BEGIN { use_ok('ZOOM') };
my $msg = ZOOM::diag_str(ZOOM::Error::INVALID_QUERY);
ok($msg eq "Invalid query", "diagnostic string lookup works");
+
+$msg = ZOOM::diag_srw_str(27);
+ok($msg eq "Empty term unsupported", "SRW diagnostic string lookup works");
my $host = "no.such.host";
my $conn;
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/25-scan.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/25-scan.t?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/25-scan.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/25-scan.t Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: 25-scan.t,v 1.10 2006/11/02 17:48:26 mike Exp $
+# $Id: 25-scan.t,v 1.11 2007/08/16 17:19:35 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 25-scan.t'
@@ -60,7 +60,7 @@
$conn->option(number => 4);
$conn->option(cqlfile => "samples/cql/pqf.properties");
-($ss, $n) = scan($conn, 1, new ZOOM::Query::CQL('title=w'), 4);
+($ss, $n) = scan($conn, 1, new ZOOM::Query::CQL2RPN('title=w', $conn), 4);
# Get last term and use it as seed for next scan
my($term, $occ) = $ss->term($n-1);
ok($ss->option("position") == 1,
Modified: branches/upstream/libnet-z3950-zoom-perl/current/typemap
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/typemap?rev=10944&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/typemap (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/typemap Fri Dec 7 01:39:10 2007
@@ -1,4 +1,4 @@
-# $Id: typemap,v 1.7 2006/11/03 09:37:57 mike Exp $
+# $Id: typemap,v 1.8 2007-10-29 11:50:49 mike Exp $
ZOOM_connection T_PTROBJ
ZOOM_connection * T_PTROBJ
@@ -67,7 +67,7 @@
else
croak(\"$var is not of type ${ntype}\")
T_OPAQUECHAR
- { unsigned _unused_len;
+ { STRLEN _unused_len;
$var = ($type) SvPV($arg, _unused_len); }
# ---------------------------------------------------------------------------
More information about the Pkg-perl-cvs-commits
mailing list