r66139 - in /branches/upstream/libnetaddr-ip-perl/current: Changes IP.pm Lite/Changes Lite/Lite.pm Lite/README Lite/t/v4-cnew.t Lite/t/v6-cnew.t MANIFEST META.yml

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Thu Dec 23 07:44:55 UTC 2010


Author: periapt-guest
Date: Thu Dec 23 07:44:21 2010
New Revision: 66139

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66139
Log:
[svn-upgrade] new version libnetaddr-ip-perl (4.038+dfsg)

Added:
    branches/upstream/libnetaddr-ip-perl/current/Lite/t/v6-cnew.t
Modified:
    branches/upstream/libnetaddr-ip-perl/current/Changes
    branches/upstream/libnetaddr-ip-perl/current/IP.pm
    branches/upstream/libnetaddr-ip-perl/current/Lite/Changes
    branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm
    branches/upstream/libnetaddr-ip-perl/current/Lite/README
    branches/upstream/libnetaddr-ip-perl/current/Lite/t/v4-cnew.t
    branches/upstream/libnetaddr-ip-perl/current/MANIFEST
    branches/upstream/libnetaddr-ip-perl/current/META.yml

Modified: branches/upstream/libnetaddr-ip-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Changes?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Changes (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Changes Thu Dec 23 07:44:21 2010
@@ -1,4 +1,12 @@
 Revision history for Perl extension NetAddr::IP
+
+4.038 Fri Dec 17 17:47:47 PST 2010
+        Modify subs "new" and "new6" in Lite.pm to accomodate
+        Cisco mask syntax that uses space instead of "/" for a separator
+        This eliminates the need for "new_cis" and "newcis6" which are now
+        deprecated.
+
+        Modify LIte/t/v4-cnew.t and add Lite/t/v6-cnew.t to test the above
 
 4.037 Fri Nov 19 10:48:01 PST 2010
         add :upper and :lower to Lite.pm v1.23

Modified: branches/upstream/libnetaddr-ip-perl/current/IP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/IP.pm?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/IP.pm (original)
+++ branches/upstream/libnetaddr-ip-perl/current/IP.pm Thu Dec 23 07:44:21 2010
@@ -4,7 +4,7 @@
 
 use strict;
 #use diagnostics;
-use NetAddr::IP::Lite 1.23 qw(Zero Zeros Ones V4mask V4net);
+use NetAddr::IP::Lite 1.24 qw(Zero Zeros Ones V4mask V4net);
 use NetAddr::IP::Util 1.35 qw(
 	sub128
 	inet_aton
@@ -34,7 +34,7 @@
 
 @ISA = qw(Exporter NetAddr::IP::Lite);
 
-$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.37 $ =~ /\d+/g) };
+$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.38 $ =~ /\d+/g) };
 
 =pod
 
@@ -481,6 +481,8 @@
 
 =item C<-E<gt>new_from_aton($netaddr)>
 
+=item new_cis and new_cis6 are DEPRECATED 
+
 =item C<-E<gt>new_cis("$addr $mask)>
 
 =item C<-E<gt>new_cis6("$addr $mask)>
@@ -501,6 +503,9 @@
 The last two methods B<new_cis> and B<new_cis6> differ from B<new> and
 B<new6> only in that they except the common Cisco address notation for
 address/mask pairs with a B<space> as a separator instead of a slash (/)
+
+These methods are DEPRECATED because the functionality is now included
+in the other "new" methods
 
   i.e.  ->new_cis('1.2.3.0 24')
         or

Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Changes?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Changes (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Changes Thu Dec 23 07:44:21 2010
@@ -1,4 +1,12 @@
 Revision history for Perl extension NetAddr::IP::Lite
+
+1.24  Fri Dec 17 17:47:47 PST 2010
+	Modify subs "new" and "new6" to accomodate
+	Cisco mask syntax that uses space instead of "/" for a separator
+	This eliminates the need for "new_cis" and "newcis6" which are now
+	deprecated.
+
+	Modify t/v4-cnew.t and add t/v6-cnew.t to test the above
 
 1.23  Fri Nov 19 10:48:01 PST 2010
 	add :upper and :lower to Lite.pm v1.23

Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm Thu Dec 23 07:44:21 2010
@@ -29,7 +29,7 @@
 
 use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $AUTOLOAD *Zero);
 
-$VERSION = do { my @r = (q$Revision: 1.23 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+$VERSION = do { my @r = (q$Revision: 1.24 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
 
 require Exporter;
 
@@ -503,6 +503,8 @@
 
 =item C<-E<gt>new_from_aton($netaddr)>
 
+=item new_cis and new_cis6 are DEPRECATED
+
 =item C<-E<gt>new_cis("$addr $mask)>
 
 =item C<-E<gt>new_cis6("$addr $mask)>
@@ -523,6 +525,9 @@
 The last two methods B<new_cis> and B<new_cis6> differ from B<new> and
 B<new6> only in that they except the common Cisco address notation for
 address/mask pairs with a B<space> as a separator instead of a slash (/)
+
+These methods are DEPRECATED because the functionality is now included
+in the other "new" methods
 
   i.e.  ->new_cis('1.2.3.0 24')
         or
@@ -568,11 +573,15 @@
 
   n.n
   n.n/mm
+  n.n mm
   n.n.n
   n.n.n/mm
+  n.n.n mm
   n.n.n.n
   n.n.n.n/mm		32 bit cidr notation
+  n.n.n.n mm
   n.n.n.n/m.m.m.m
+  n.n.n.n m.m.m.m
   loopback, localhost, broadcast, any, default
   x.x.x.x/host
   0xABCDEF, 0b111111000101011110, (or a bcd number)
@@ -712,7 +721,8 @@
 
   while (1) {
     unless (@_) {
-      if ($ip =~ m!^(.+)/(.+)$!) {
+#      if ($ip =~ m!^(.+)/(.+)$!) {
+      if ($ip =~ m!^([a-z0-9.:-]+)(?:/|\s+)([a-z0-9.:-]+)$!) {
 	$ip	= $1;
 	$mask	= $2;
       } elsif (grep($ip eq $_,qw(default any broadcast loopback unspecified))) {

Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/README?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/README (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/README Thu Dec 23 07:44:21 2010
@@ -187,6 +187,7 @@
     "->new6([$addr, [ $mask]])"
     "->new_no([$addr, [ $mask]])"
     "->new_from_aton($netaddr)"
+    new_cis and new_cis6 are DEPRECATED
     "->new_cis("$addr $mask)"
     "->new_cis6("$addr $mask)"
         The first two methods create a new address with the supplied address
@@ -207,6 +208,9 @@
         address/mask pairs with a space as a separator instead of a slash
         (/)
 
+        These methods are DEPRECATED because the functionality is now
+        included in the other "new" methods
+
           i.e.  ->new_cis('1.2.3.0 24')
                 or
                 ->new_cis6('::1.2.3.0 120')
@@ -250,11 +254,15 @@
 
           n.n
           n.n/mm
+          n.n mm
           n.n.n
           n.n.n/mm
+          n.n.n mm
           n.n.n.n
           n.n.n.n/mm            32 bit cidr notation
+          n.n.n.n mm
           n.n.n.n/m.m.m.m
+          n.n.n.n m.m.m.m
           loopback, localhost, broadcast, any, default
           x.x.x.x/host
           0xABCDEF, 0b111111000101011110, (or a bcd number)

Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/t/v4-cnew.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/t/v4-cnew.t?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/t/v4-cnew.t (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/t/v4-cnew.t Thu Dec 23 07:44:21 2010
@@ -5,6 +5,10 @@
 	       [ '127.1/16', '127.1.0.0/16' ],
 	       [ '10.10.10', '10.10.0.10/32' ],
 	       [ '10.10.10/24', '10.10.10.0/24' ],
+# include test for cisco syntax using space instead of '/'
+	       [ '127.1 16', '127.1.0.0/16' ],
+	       [ '10.10.10 24', '10.10.10.0/24' ],
+	       [ '10.10.10 255.255.255.0', '10.10.10.0/24' ],
 	       );
 
 $| = 1;

Added: branches/upstream/libnetaddr-ip-perl/current/Lite/t/v6-cnew.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/t/v6-cnew.t?rev=66139&op=file
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/t/v6-cnew.t (added)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/t/v6-cnew.t Thu Dec 23 07:44:21 2010
@@ -1,0 +1,27 @@
+use NetAddr::IP::Lite;
+
+my @subnets = (
+	       [ 'dead:beef:1234::/16', 'DEAD:BEEF:1234:0:0:0:0:0/16' ],
+	       [ '::1234:BEEF:DEAD/24', '0:0:0:0:0:1234:BEEF:DEAD/24' ],
+# include test for cisco syntax using space instead of '/'
+	       [ 'dead:beef:1234:: 16', 'DEAD:BEEF:1234:0:0:0:0:0/16' ],
+	       [ '::1234:BEEF:DEAD 24', '0:0:0:0:0:1234:BEEF:DEAD/24' ],
+	       [ '::1234:BEEF:DEAD FFFF:FF00::', '0:0:0:0:0:1234:BEEF:DEAD/24' ],
+	       );
+$| = 1;
+
+print '1..', (scalar @subnets) , "\n";
+
+my $count = 1;
+
+for my $n (@subnets) {
+    my $ip = new NetAddr::IP::Lite $n->[0];
+    if ($ip eq $n->[1]) {
+	print "ok $count\n";
+    }
+    else {
+	print $ip, "\nnot ok $count\n";
+    }
+
+    ++ $count;
+}

Modified: branches/upstream/libnetaddr-ip-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/MANIFEST?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/MANIFEST (original)
+++ branches/upstream/libnetaddr-ip-perl/current/MANIFEST Thu Dec 23 07:44:21 2010
@@ -56,6 +56,7 @@
 Lite/t/v4-range.t
 Lite/t/v4-snew.t
 Lite/t/v4-wnew.t
+Lite/t/v6-cnew.t
 Lite/t/v6-contains.t
 Lite/t/v6-inc.t
 Lite/t/v6-new_cis6_base.t

Modified: branches/upstream/libnetaddr-ip-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/META.yml?rev=66139&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/META.yml (original)
+++ branches/upstream/libnetaddr-ip-perl/current/META.yml Thu Dec 23 07:44:21 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                NetAddr-IP
-version:             4.037
+version:             4.038
 abstract:            Manages IPv4 and IPv6 addresses and subnets
 license:             ~
 author:              




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