r27697 - in /trunk/liburi-perl: ./ URI/ URI/file/ URI/urn/ debian/ t/

kees at users.alioth.debian.org kees at users.alioth.debian.org
Thu Dec 4 07:03:46 UTC 2008


Author: kees
Date: Thu Dec  4 07:03:43 2008
New Revision: 27697

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27697
Log:
1.37-1: bump standards version, clean up debian/control

Added:
    trunk/liburi-perl/META.yml
      - copied unchanged from r27696, branches/upstream/liburi-perl/current/META.yml
    trunk/liburi-perl/rfc2396.txt
      - copied unchanged from r27696, branches/upstream/liburi-perl/current/rfc2396.txt
    trunk/liburi-perl/t/cwd.t
      - copied unchanged from r27696, branches/upstream/liburi-perl/current/t/cwd.t
    trunk/liburi-perl/t/gopher.t
      - copied unchanged from r27696, branches/upstream/liburi-perl/current/t/gopher.t
    trunk/liburi-perl/t/utf8.t
      - copied unchanged from r27696, branches/upstream/liburi-perl/current/t/utf8.t
Modified:
    trunk/liburi-perl/Changes
    trunk/liburi-perl/MANIFEST
    trunk/liburi-perl/README
    trunk/liburi-perl/URI.pm
    trunk/liburi-perl/URI/Escape.pm
    trunk/liburi-perl/URI/Heuristic.pm
    trunk/liburi-perl/URI/Split.pm
    trunk/liburi-perl/URI/_generic.pm
    trunk/liburi-perl/URI/_query.pm
    trunk/liburi-perl/URI/data.pm
    trunk/liburi-perl/URI/file.pm
    trunk/liburi-perl/URI/file/Base.pm
    trunk/liburi-perl/URI/file/Mac.pm
    trunk/liburi-perl/URI/mailto.pm
    trunk/liburi-perl/URI/sip.pm
    trunk/liburi-perl/URI/urn/isbn.pm
    trunk/liburi-perl/debian/changelog
    trunk/liburi-perl/debian/control
    trunk/liburi-perl/debian/copyright
    trunk/liburi-perl/t/data.t
    trunk/liburi-perl/t/file.t
    trunk/liburi-perl/t/heuristic.t
    trunk/liburi-perl/t/query.t
    trunk/liburi-perl/t/rel.t
    trunk/liburi-perl/t/urn-isbn.t

Modified: trunk/liburi-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/Changes?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/Changes (original)
+++ trunk/liburi-perl/Changes Thu Dec  4 07:03:43 2008
@@ -1,3 +1,36 @@
+2008-06-16   Gisle Aas <gisle at ActiveState.com>
+
+   Release 1.37
+
+   Gisle Aas (1):
+      Support ";" delimiter in $u->query_form
+
+   Jan Dubois (1):
+      We get different test result when www.perl.com doesn't resolve.
+
+   Kenichi Ishigaki (1):
+      URI::Heuristic didn't work for generic country code [RT#35156]
+
+
+
+2008-04-03   Gisle Aas <gisle at ActiveState.com>
+
+   Release 1.36
+
+   <gerard at tty.nl>: Escape Unicode strings as UTF-8.
+
+   Bjoern Hoehrmann <derhoermi at gmx.net>: fixed URL encoded data: URLs
+
+   GAAS: uri_escape_utf8() now exported by default as documented.
+
+   BDFOY: Test fails with Business::ISBN installed [RT#33220]
+
+   JDHEDDEN: lc(undef) reports warning in blead [RT#32742]
+
+   GEOFFR: add some tests for gopher URIs [RT#29211]
+
+
+
 2004-11-05   Gisle Aas <gisle at ActiveState.com>
 
    Release 1.35

Modified: trunk/liburi-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/MANIFEST?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/MANIFEST (original)
+++ trunk/liburi-perl/MANIFEST Thu Dec  4 07:03:43 2008
@@ -54,11 +54,13 @@
 rfc2396.txt
 t/abs.t
 t/clone.t
+t/cwd.t
 t/data.t
 t/escape.t
 t/file.t
 t/ftp.t
 t/generic.t
+t/gopher.t
 t/heuristic.t
 t/http.t
 t/ldap.t
@@ -89,4 +91,6 @@
 t/storable-test.pl
 t/urn-isbn.t
 t/urn-oid.t
+t/utf8.t
 uri-test
+META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/liburi-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/README?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/README (original)
+++ trunk/liburi-perl/README Thu Dec  4 07:03:43 2008
@@ -23,7 +23,7 @@
 comp.lang.perl.modules USENET Newsgroup.  Bug reports and suggestions
 for improvements can be sent to the <libwww at perl.org> mailing list.
 
-Copyright 1998-2003 Gisle Aas.
+Copyright 1998-2004,2008 Gisle Aas.
 Copyright 1998 Graham Barr.
 
 This library is free software; you can redistribute it and/or modify

Modified: trunk/liburi-perl/URI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI.pm (original)
+++ trunk/liburi-perl/URI.pm Thu Dec  4 07:03:43 2008
@@ -2,9 +2,9 @@
 
 use strict;
 use vars qw($VERSION);
-$VERSION = "1.35"; # $Date: 2004/11/05 14:17:33 $
-
-use vars qw($ABS_REMOTE_LEADING_DOTS $ABS_ALLOW_RELATIVE_SCHEME);
+$VERSION = "1.37";
+
+use vars qw($ABS_REMOTE_LEADING_DOTS $ABS_ALLOW_RELATIVE_SCHEME $DEFAULT_QUERY_FORM_DELIMITER);
 
 my %implements;  # mapping from scheme to implementor class
 
@@ -73,7 +73,8 @@
 {
     my $class = shift;
     my($str, $scheme) = @_;
-    $str =~ s/([^$uric\#])/$URI::Escape::escapes{$1}/go;
+    # find all funny characters and encode the bytes.
+    $str =~ s*([^$uric\#])* URI::Escape::escape_char($1) *ego;
     $str = "$scheme:$str" unless $str =~ /^$scheme_re:/o ||
                                  $class->_no_scheme_ok;
     my $self = bless \$str, $class;
@@ -204,7 +205,7 @@
 
     my $new_opaque = shift;
     $new_opaque = "" unless defined $new_opaque;
-    $new_opaque =~ s/([^$uric])/$URI::Escape::escapes{$1}/go;
+    $new_opaque =~ s/([^$uric])/ URI::Escape::escape_char($1)/ego;
 
     $$self = defined($old_scheme) ? $old_scheme : "";
     $$self .= $new_opaque;
@@ -229,7 +230,7 @@
 
     my $new_frag = shift;
     if (defined $new_frag) {
-	$new_frag =~ s/([^$uric])/$URI::Escape::escapes{$1}/go;
+	$new_frag =~ s/([^$uric])/ URI::Escape::escape_char($1) /ego;
 	$$self .= "#$new_frag";
     }
     $old;
@@ -585,9 +586,15 @@
 
 =item $uri->query_form( $key1 => $val1, $key2 => $val2, ... )
 
+=item $uri->query_form( $key1 => $val1, $key2 => $val2, ..., $delim )
+
 =item $uri->query_form( \@key_value_pairs )
 
+=item $uri->query_form( \@key_value_pairs, $delim )
+
 =item $uri->query_form( \%hash )
+
+=item $uri->query_form( \%hash, $delim )
 
 Sets and returns query components that use the
 I<application/x-www-form-urlencoded> format.  Key/value pairs are
@@ -613,6 +620,13 @@
     $uri->query_form([ foo => [1, 2] ]);
     $uri->query_form({ foo => [1, 2] });
 
+The $delim parameter can be passed as ";" to force the key/value pairs
+to be delimited by ";" instead of "&" in the query string.  This
+practice is often recommened for URLs embedded in HTML or XML
+documents as this avoids the trouble of escaping the "&" character.
+You might also set the $URI::DEFAULT_QUERY_FORM_DELIMITER variable to
+";" for the same global effect.
+
 The C<URI::QueryParam> module can be loaded to add further methods to
 manipulate the form of a URI.  See L<URI::QueryParam> for details.
 
@@ -907,7 +921,8 @@
 Numbers (ISBNs) and is described in RFC 3187.  A C<URI> object belonging
 to this namespace has the following extra methods (if the
 Business::ISBN module is available): $uri->isbn,
-$uri->isbn_publisher_code, $uri->isbn_country_code, $uri->isbn_as_ean.
+$uri->isbn_publisher_code, $uri->isbn_group_code (formerly isbn_country_code,
+which is still supported by issues a deprecation warning), $uri->isbn_as_ean.
 
 =item B<urn>:B<oid>:
 
@@ -956,6 +971,11 @@
   URI->new("../../../foo")->abs("http://host/a/b")
       ==> "http://host/foo"
 
+=item $URI::DEFAULT_QUERY_FORM_DELIMITER
+
+This value can be set to ";" to have the query form C<key=value> pairs
+delimited by ";" instead of "&" which is the default.
+
 =back
 
 =head1 BUGS
@@ -995,7 +1015,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 1995-2003 Gisle Aas.
+Copyright 1995-2004,2008 Gisle Aas.
 
 Copyright 1995 Martijn Koster.
 

Modified: trunk/liburi-perl/URI/Escape.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/Escape.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/Escape.pm (original)
+++ trunk/liburi-perl/URI/Escape.pm Thu Dec  4 07:03:43 2008
@@ -1,7 +1,3 @@
-#
-# $Id: Escape.pm,v 3.28 2004/11/05 13:58:31 gisle Exp $
-#
-
 package URI::Escape;
 use strict;
 
@@ -147,9 +143,9 @@
 
 require Exporter;
 @ISA = qw(Exporter);
- at EXPORT = qw(uri_escape uri_unescape);
- at EXPORT_OK = qw(%escapes uri_escape_utf8);
-$VERSION = sprintf("%d.%02d", q$Revision: 3.28 $ =~ /(\d+)\.(\d+)/);
+ at EXPORT = qw(uri_escape uri_unescape uri_escape_utf8);
+ at EXPORT_OK = qw(%escapes);
+$VERSION = "3.29";
 
 use Carp ();
 
@@ -215,4 +211,8 @@
     $str;
 }
 
+sub escape_char {
+    return join '', @URI::Escape::escapes{$_[0] =~ /(\C)/g};
+}
+
 1;

Modified: trunk/liburi-perl/URI/Heuristic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/Heuristic.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/Heuristic.pm (original)
+++ trunk/liburi-perl/URI/Heuristic.pm Thu Dec  4 07:03:43 2008
@@ -1,6 +1,4 @@
 package URI::Heuristic;
-
-# $Id: Heuristic.pm,v 4.17 2004/01/14 13:33:44 gisle Exp $
 
 =head1 NAME
 
@@ -89,7 +87,7 @@
 require Exporter;
 *import = \&Exporter::import;
 @EXPORT_OK = qw(uf_uri uf_uristr uf_url uf_urlstr);
-$VERSION = sprintf("%d.%02d", q$Revision: 4.17 $ =~ /(\d+)\.(\d+)/);
+$VERSION = "4.18";
 
 sub MY_COUNTRY() {
     for ($MY_COUNTRY) {
@@ -174,7 +172,7 @@
 			    push(@guess, map { s/\bACME\b/$host/; $_ }
                                                @special);
 			} else {
-			    push(@guess, 'www.$host.' . MY_COUNTRY());
+			    push(@guess, "www.$host." . MY_COUNTRY());
 			}
 		    }
 		    push(@guess, map "www.$host.$_",

Modified: trunk/liburi-perl/URI/Split.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/Split.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/Split.pm (original)
+++ trunk/liburi-perl/URI/Split.pm Thu Dec  4 07:03:43 2008
@@ -18,7 +18,7 @@
     my $uri = defined($scheme) ? "$scheme:" : "";
     $path = "" unless defined $path;
     if (defined $auth) {
-	$auth =~ s,([/?\#]),$URI::Escape::escapes{$1},g;
+	$auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg;
 	$uri .= "//$auth";
 	$path = "/$path" if length($path) && $path !~ m,^/,;
     }
@@ -26,12 +26,12 @@
 	$uri .= "//";  # XXX force empty auth
     }
     unless (length $uri) {
-	$path =~ s,(:),$URI::Escape::escapes{$1}, while $path =~ m,^[^:/?\#]+:,;
+	$path =~ s,(:), URI::Escape::escape_char($1),e while $path =~ m,^[^:/?\#]+:,;
     }
-    $path =~ s,([?\#]),$URI::Escape::escapes{$1},g;
+    $path =~ s,([?\#]), URI::Escape::escape_char($1),eg;
     $uri .= $path;
     if (defined $query) {
-	$query =~ s,(\#),$URI::Escape::escapes{$1},g;
+	$query =~ s,(\#), URI::Escape::escape_char($1),eg;
 	$uri .= "?$query";
     }
     $uri .= "#$frag" if defined $frag;

Modified: trunk/liburi-perl/URI/_generic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/_generic.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/_generic.pm (original)
+++ trunk/liburi-perl/URI/_generic.pm Thu Dec  4 07:03:43 2008
@@ -22,7 +22,7 @@
 	$$self = $1;
 	my $rest = $3;
 	if (defined $auth) {
-	    $auth =~ s/([^$ACHAR])/$URI::Escape::escapes{$1}/go;
+	    $auth =~ s/([^$ACHAR])/ URI::Escape::escape_char($1)/ego;
 	    $$self .= "//$auth";
 	}
 	_check_path($rest, $$self);
@@ -41,7 +41,7 @@
 	my $rest = $3;
 	my $new_path = shift;
 	$new_path = "" unless defined $new_path;
-	$new_path =~ s/([^$PCHAR])/$URI::Escape::escapes{$1}/go;
+	$new_path =~ s/([^$PCHAR])/ URI::Escape::escape_char($1)/ego;
 	_check_path($new_path, $$self);
 	$$self .= $new_path . $rest;
     }
@@ -58,7 +58,7 @@
 	my $rest = $3;
 	my $new_path = shift;
 	$new_path = "" unless defined $new_path;
-	$new_path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
+	$new_path =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego;
 	_check_path($new_path, $$self);
 	$$self .= $new_path . $rest;
     }

Modified: trunk/liburi-perl/URI/_query.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/_query.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/_query.pm (original)
+++ trunk/liburi-perl/URI/_query.pm Thu Dec  4 07:03:43 2008
@@ -13,7 +13,7 @@
 	my $q = shift;
 	$$self = $1;
 	if (defined $q) {
-	    $q =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
+	    $q =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego;
 	    $$self .= "?$q";
 	}
 	$$self .= $3;
@@ -27,35 +27,46 @@
     my $old = $self->query;
     if (@_) {
         # Try to set query string
-	my @new = @_;
-	if (@new == 1) {
-	    my $n = $new[0];
-	    if (ref($n) eq "ARRAY") {
-		@new = @$n;
-	    }
-	    elsif (ref($n) eq "HASH") {
-		@new = %$n;
-	    }
-	}
+        my $delim;
+        my $r = $_[0];
+        if (ref($r) eq "ARRAY") {
+            $delim = $_[1];
+            @_ = @$r;
+        }
+        elsif (ref($r) eq "HASH") {
+            $delim = $_[1];
+            @_ = %$r;
+        }
+        $delim = pop if @_ % 2;
+
         my @query;
-        while (my($key,$vals) = splice(@new, 0, 2)) {
+        while (my($key,$vals) = splice(@_, 0, 2)) {
             $key = '' unless defined $key;
-	    $key =~ s/([;\/?:@&=+,\$\[\]%])/$URI::Escape::escapes{$1}/g;
+	    $key =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg;
 	    $key =~ s/ /+/g;
 	    $vals = [ref($vals) eq "ARRAY" ? @$vals : $vals];
             for my $val (@$vals) {
                 $val = '' unless defined $val;
-		$val =~ s/([;\/?:@&=+,\$\[\]%])/$URI::Escape::escapes{$1}/g;
+		$val =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg;
                 $val =~ s/ /+/g;
                 push(@query, "$key=$val");
             }
         }
-        $self->query(@query ? join('&', @query) : undef);
+        if (@query) {
+            unless ($delim) {
+                $delim = $1 if $old && $old =~ /([&;])/;
+                $delim ||= $URI::DEFAULT_QUERY_FORM_DELIMITER || "&";
+            }
+            $self->query(join($delim, @query));
+        }
+        else {
+            $self->query(undef);
+        }
     }
     return if !defined($old) || !length($old) || !defined(wantarray);
     return unless $old =~ /=/; # not a form
     map { s/\+/ /g; uri_unescape($_) }
-         map { /=/ ? split(/=/, $_, 2) : ($_ => '')} split(/&/, $old);
+         map { /=/ ? split(/=/, $_, 2) : ($_ => '')} split(/[&;]/, $old);
 }
 
 # Handle ...?dog+bones type of query
@@ -67,7 +78,7 @@
         # Try to set query string
 	my @copy = @_;
 	@copy = @{$copy[0]} if @copy == 1 && ref($copy[0]) eq "ARRAY";
-	for (@copy) { s/([;\/?:@&=+,\$\[\]%])/$URI::Escape::escapes{$1}/g; }
+	for (@copy) { s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg; }
 	$self->query(@copy ? join('+', @copy) : undef);
     }
     return if !defined($old) || !defined(wantarray);

Modified: trunk/liburi-perl/URI/data.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/data.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/data.pm (original)
+++ trunk/liburi-perl/URI/data.pm Thu Dec  4 07:03:43 2008
@@ -55,7 +55,8 @@
 	$self->opaque("$enc,$new");
     }
     return unless defined wantarray;
-    return $base64 ? decode_base64($data) : uri_unescape($data);
+    $data = uri_unescape($data);
+    return $base64 ? decode_base64($data) : $data;
 }
 
 # I could not find a better way to interpolate the tr/// chars from

Modified: trunk/liburi-perl/URI/file.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/file.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/file.pm (original)
+++ trunk/liburi-perl/URI/file.pm Thu Dec  4 07:03:43 2008
@@ -5,7 +5,7 @@
 
 require URI::_generic;
 @ISA = qw(URI::_generic);
-$VERSION = sprintf("%d.%02d", q$Revision: 4.19 $ =~ /(\d+)\.(\d+)/);
+$VERSION = "4.20";
 
 use URI::Escape qw(uri_unescape);
 

Modified: trunk/liburi-perl/URI/file/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/file/Base.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/file/Base.pm (original)
+++ trunk/liburi-perl/URI/file/Base.pm Thu Dec  4 07:03:43 2008
@@ -16,7 +16,7 @@
 
     if (defined $auth) {
 	$auth =~ s,%,%25,g unless $escaped_auth;
-	$auth =~ s,([/?\#]),$URI::Escape::escapes{$1},g;
+	$auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg;
 	$auth = "//$auth";
 	if (defined $path) {
 	    $path = "/$path" unless substr($path, 0, 1) eq "/";
@@ -28,7 +28,7 @@
 	$auth = "";
     }
 
-    $path =~ s,([%;?]),$URI::Escape::escapes{$1},g unless $escaped_path;
+    $path =~ s,([%;?]), URI::Escape::escape_char($1),eg unless $escaped_path;
     $path =~ s/\#/%23/g;
 
     my $uri = $auth . $path;

Modified: trunk/liburi-perl/URI/file/Mac.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/file/Mac.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/file/Mac.pm (original)
+++ trunk/liburi-perl/URI/file/Mac.pm Thu Dec  4 07:03:43 2008
@@ -25,7 +25,7 @@
     }
 
     my $isdir = ($path =~ s/:$//);
-    $path =~ s,([%/;]),$URI::Escape::escapes{$1},g;
+    $path =~ s,([%/;]), URI::Escape::escape_char($1),eg;
 
     my @path = split(/:/, $path, -1);
     for (@path) {

Modified: trunk/liburi-perl/URI/mailto.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/mailto.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/mailto.pm (original)
+++ trunk/liburi-perl/URI/mailto.pm Thu Dec  4 07:03:43 2008
@@ -14,7 +14,7 @@
 	my @new = @old;
 	# get rid of any other to: fields
 	for (my $i = 0; $i < @new; $i += 2) {
-	    if (lc($new[$i]) eq "to") {
+	    if (lc($new[$i] || '') eq "to") {
 		splice(@new, $i, 2);
 		redo;
 	    }
@@ -51,7 +51,7 @@
 	# strip out any "to" fields
 	my @to;
 	for (my $i=0; $i < @new; $i += 2) {
-	    if (lc($new[$i]) eq "to") {
+	    if (lc($new[$i] || '') eq "to") {
 		push(@to, (splice(@new, $i, 2))[1]);  # remove header
 		redo;
 	    }

Modified: trunk/liburi-perl/URI/sip.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/sip.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/sip.pm (original)
+++ trunk/liburi-perl/URI/sip.pm Thu Dec  4 07:03:43 2008
@@ -30,7 +30,7 @@
         $$self = defined($1) ? $1 : "";
         my $rest = $3;
         if (defined $auth) {
-            $auth =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
+            $auth =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego;
             $$self .= "$auth";
         }
         $$self .= $rest;

Modified: trunk/liburi-perl/URI/urn/isbn.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI/urn/isbn.pm?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/URI/urn/isbn.pm (original)
+++ trunk/liburi-perl/URI/urn/isbn.pm Thu Dec  4 07:03:43 2008
@@ -4,9 +4,17 @@
 @ISA=qw(URI::urn);
 
 use strict;
-use Business::ISBN ();
+use Carp qw(carp);
 
-
+BEGIN {
+    require Business::ISBN;
+    
+    local $^W = 0; # don't warn about dev versions, perl5.004 style
+    warn "Using Business::ISBN version " . Business::ISBN->VERSION . 
+        " which is deprecated.\nUpgrade to Business::ISBN version 2\n"
+        if Business::ISBN->VERSION < 2;
+    }
+    
 sub _isbn {
     my $nss = shift;
     $nss = $nss->nss if ref($nss);
@@ -35,14 +43,50 @@
     return $isbn->publisher_code;
 }
 
+BEGIN {
+my $group_method = do {
+    local $^W = 0; # don't warn about dev versions, perl5.004 style
+    Business::ISBN->VERSION >= 2 ? 'group_code' : 'country_code';
+    };
+
+sub isbn_group_code {
+    my $isbn = shift->_isbn || return undef;
+    return $isbn->$group_method;
+}
+}
+
 sub isbn_country_code {
+    my $name = (caller(0))[3]; $name =~ s/.*:://;
+    carp "$name is DEPRECATED. Use isbn_group_code instead";
+    
+    no strict 'refs';
+    &isbn_group_code;
+}
+
+BEGIN {
+my $isbn13_method = do {
+    local $^W = 0; # don't warn about dev versions, perl5.004 style
+    Business::ISBN->VERSION >= 2 ? 'as_isbn13' : 'as_ean';
+    };
+
+sub isbn13 {
     my $isbn = shift->_isbn || return undef;
-    return $isbn->country_code;
+    
+    # Business::ISBN 1.x didn't put hyphens in the EAN, and it was just a string
+    # Business::ISBN 2.0 doesn't do EAN, but it does ISBN-13 objects
+    #   and it uses the hyphens, so call as_string with an empty anon array
+    # or, adjust the test and features to say that it comes out with hyphens.
+    my $thingy = $isbn->$isbn13_method;
+    return eval { $thingy->can( 'as_string' ) } ? $thingy->as_string([]) : $thingy;
+}
 }
 
 sub isbn_as_ean {
-    my $isbn = shift->_isbn || return undef;
-    return $isbn->as_ean;
+    my $name = (caller(0))[3]; $name =~ s/.*:://;
+    carp "$name is DEPRECATED. Use isbn13 instead";
+
+    no strict 'refs';
+    &isbn13;
 }
 
 sub canonical {

Modified: trunk/liburi-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/debian/changelog?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/debian/changelog (original)
+++ trunk/liburi-perl/debian/changelog Thu Dec  4 07:03:43 2008
@@ -1,8 +1,14 @@
-liburi-perl (1.35.dfsg.1-2) UNRELEASED; urgency=low
+liburi-perl (1.37+dfsg-1) UNRELEASED; urgency=low
 
-  * Take over for the Debian Perl Group
+  * (NEEDS TO DROP non-dfsg rfc from orig.tar.gz)
+  * (NOT RELEASED YET) New upstream release (Closes: #507286).
+  * debian/control:
+    - Take over for the Debian Perl Group, with permission from Stefan
+      Hornburg.
+    - Clean up long description (Closes: #433968).
+    - Bump standards version to 3.8.0 (added Homepage).
 
- -- Damyan Ivanov <dmn at debian.org>  Thu, 04 Dec 2008 08:45:14 +0200
+ -- Kees Cook <kees at outflux.net>  Wed, 03 Dec 2008 22:51:28 -0800
 
 liburi-perl (1.35.dfsg.1-1) unstable; urgency=low
 

Modified: trunk/liburi-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/debian/control?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/debian/control (original)
+++ trunk/liburi-perl/debian/control Thu Dec  4 07:03:43 2008
@@ -3,17 +3,20 @@
 Priority: optional
 Build-Depends-Indep: perl (>= 5.6.0-16)
 Build-Depends: debhelper (>= 5)
-Maintainer: Stefan Hornburg (Racke) <racke at linuxia.de>
-Standards-Version: 3.7.2.2
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Uploaders: Stefan Hornburg (Racke) <racke at linuxia.de>,
+ Kees Cook <kees at outflux.net>, Rene Mayorga <rmayorga at debian.org.sv>
+Standards-Version: 3.8.0
+Homepage: http://search.cpan.org/dist/URI/
+Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liburi-perl/
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liburi-perl/
 
 Package: liburi-perl
 Architecture: all
-Depends: perl, ${perl:Depends}, libmime-base64-perl, libnet-perl, data-dumper
+Depends: ${perl:Depends}, libmime-base64-perl, libnet-perl, data-dumper
 Suggests: libwww-perl (>=5.41)
 Conflicts: libwww-perl (<<5.41)
 Description: Manipulates and accesses URI strings
- From the README:
- .
  This package contains the URI.pm module with friends.  The module
  implements the URI class.  Objects of this class represent Uniform
  Resource Identifier (URI) references as specified in RFC 2396.
@@ -26,4 +29,3 @@
  with libwww-perl.  This package contains an emulation of the old
  URI::URL interface.  The emulated URI::URL implement both the old and
  the new interface.
-

Modified: trunk/liburi-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/debian/copyright?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/debian/copyright (original)
+++ trunk/liburi-perl/debian/copyright Thu Dec  4 07:03:43 2008
@@ -13,5 +13,3 @@
 
 Debian GNU/Linux users can find the Perl license terms under
 /usr/share/common-licenses/Artistic and /usr/share/common-licenses/GPL.
-
-

Modified: trunk/liburi-perl/t/data.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/data.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/data.t (original)
+++ trunk/liburi-perl/t/data.t Thu Dec  4 07:03:43 2008
@@ -9,7 +9,7 @@
     exit;
 }
 
-print "1..21\n";
+print "1..22\n";
 
 use URI;
 
@@ -106,3 +106,5 @@
 print "not " unless $old eq "" && $u eq "data:bar%2Cb%E5z,new";
 print "ok 21\n";
 
+print "not " unless URI->new('data:;base64,%51%6D%70%76%5A%58%4A%75')->data eq "Bjoern";
+print "ok 22\n";

Modified: trunk/liburi-perl/t/file.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/file.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/file.t (original)
+++ trunk/liburi-perl/t/file.t Thu Dec  4 07:03:43 2008
@@ -1,4 +1,4 @@
-#!perl -w
+#!perl -Tw
 
 use URI::file;
 

Modified: trunk/liburi-perl/t/heuristic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/heuristic.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/heuristic.t (original)
+++ trunk/liburi-perl/t/heuristic.t Thu Dec  4 07:03:43 2008
@@ -45,7 +45,7 @@
     # DNS probably work, lets run test 6..8
 
     $URI::Heuristic::MY_COUNTRY = "bv";
-    print "not " unless uf_urlstr("perl/camel.gif") eq "http://www.perl.com/camel.gif";
+    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(com|org)/camel\.gif$,;
     print "ok 6\n";
 
     $URI::Heuristic::MY_COUNTRY = "uk";

Modified: trunk/liburi-perl/t/query.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/query.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/query.t (original)
+++ trunk/liburi-perl/t/query.t Thu Dec  4 07:03:43 2008
@@ -1,6 +1,6 @@
 #!perl -w
 
-print "1..18\n";
+print "1..23\n";
 
 use strict;
 use URI ();
@@ -80,6 +80,30 @@
 print "not " unless "$u" =~ /^\?a=HASH\(/;
 print "ok 18\n";
 
+$u->query_form(a => 1, b => 2, ';');
+print "not " unless $u eq "?a=1;b=2";
+print "ok 19\n";
+
+$u->query_form(a => 1, c => 2);
+print "not " unless $u eq "?a=1;c=2";
+print "ok 20\n";
+
+$u->query_form(a => 1, c => 2, '&');
+print "not " unless $u eq "?a=1&c=2";
+print "ok 21\n";
+
+$u->query_form([a => 1, b => 2], ';');
+print "not " unless $u eq "?a=1;b=2";
+print "ok 22\n";
+
+$u->query_form([]);
+{
+    local $URI::DEFAULT_QUERY_FORM_DELIMITER = ';';
+    $u->query_form(a => 1, b => 2);
+}
+print "not " unless $u eq "?a=1;b=2";
+print "ok 23\n";
+
 __END__
 # Some debugging while writing new tests
 print "\@q='", join(":", @q), "'\n";

Modified: trunk/liburi-perl/t/rel.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/rel.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/rel.t (original)
+++ trunk/liburi-perl/t/rel.t Thu Dec  4 07:03:43 2008
@@ -1,21 +1,21 @@
 #!/usr/bin/perl -w
 
-print "1..4\n";
+use Test;
+
+plan tests => 6;
 
 use strict;
 use URI;
 
-my $uri = URI->new("http://www.example.com/foo/bar/");
+my $uri;
 
-print "not " unless $uri->rel("http://www.example.com/foo/bar/") eq "./";
-print "ok 1\n";
+$uri = URI->new("http://www.example.com/foo/bar/");
+ok($uri->rel("http://www.example.com/foo/bar/"), "./");
+ok($uri->rel("HTTP://WWW.EXAMPLE.COM/foo/bar/"), "./");
+ok($uri->rel("HTTP://WWW.EXAMPLE.COM/FOO/BAR/"), "../../foo/bar/");
+ok($uri->rel("HTTP://WWW.EXAMPLE.COM:80/foo/bar/"), "./");
 
-print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM/foo/bar/") eq "./";
-print "ok 2\n";
+$uri = URI->new("http://www.example.com/foo/bar");
+ok($uri->rel("http://www.example.com/foo/bar"), "bar");
+ok($uri->rel("http://www.example.com/foo"), "foo/bar");
 
-print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM/FOO/BAR/") eq "../../foo/bar/";
-print "ok 3\n";
-
-print "not " unless $uri->rel("HTTP://WWW.EXAMPLE.COM:80/foo/bar/") eq "./";
-print "ok 4\n";
-

Modified: trunk/liburi-perl/t/urn-isbn.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/urn-isbn.t?rev=27697&op=diff
==============================================================================
--- trunk/liburi-perl/t/urn-isbn.t (original)
+++ trunk/liburi-perl/t/urn-isbn.t Thu Dec  4 07:03:43 2008
@@ -25,13 +25,13 @@
 print "not " unless $u->isbn eq "0-395-36341-1";
 print "ok 3\n";
 
-print "not " unless $u->isbn_country_code == 0;
+print "not " unless $u->isbn_group_code == 0;
 print "ok 4\n";
 
 print "not " unless $u->isbn_publisher_code == 395;
 print "ok 5\n";
 
-print "not " unless $u->isbn_as_ean eq "9780395363416";
+print "not " unless $u->isbn13 eq "9780395363416";
 print "ok 6\n";
 
 print "not " unless $u->nss eq "0395363411";




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