r19454 - in /branches/upstream/libnet-mac-perl/current: Changes MANIFEST META.yml README lib/Net/MAC.pm t/10_convert_args.t

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Tue May 6 01:10:40 UTC 2008


Author: gwolf
Date: Tue May  6 01:10:39 2008
New Revision: 19454

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

Added:
    branches/upstream/libnet-mac-perl/current/t/10_convert_args.t
Modified:
    branches/upstream/libnet-mac-perl/current/Changes
    branches/upstream/libnet-mac-perl/current/MANIFEST
    branches/upstream/libnet-mac-perl/current/META.yml
    branches/upstream/libnet-mac-perl/current/README
    branches/upstream/libnet-mac-perl/current/lib/Net/MAC.pm

Modified: branches/upstream/libnet-mac-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/Changes?rev=19454&op=diff
==============================================================================
--- branches/upstream/libnet-mac-perl/current/Changes (original)
+++ branches/upstream/libnet-mac-perl/current/Changes Tue May  6 01:10:39 2008
@@ -1,4 +1,8 @@
 # This file documents the revision history for Perl extension Net::MAC.
+
+1.4     2008-05-01 14:53 GMT+1
+        - Fix rt.cpan#34680
+          Unspecified delimiter to convert() when bit_group() is not 48
 
 1.3     2008-03-30 19:12 GMT+1
         - Added Changes file.

Modified: branches/upstream/libnet-mac-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/MANIFEST?rev=19454&op=diff
==============================================================================
--- branches/upstream/libnet-mac-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-mac-perl/current/MANIFEST Tue May  6 01:10:39 2008
@@ -5,6 +5,7 @@
 README
 lib/Net/MAC.pm
 scripts/gen_macs.pl
+t/10_convert_args.t
 t/100_base10_macs.pl
 t/100_base16_macs.pl
 t/Net-MAC.t

Modified: branches/upstream/libnet-mac-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/META.yml?rev=19454&op=diff
==============================================================================
--- branches/upstream/libnet-mac-perl/current/META.yml (original)
+++ branches/upstream/libnet-mac-perl/current/META.yml Tue May  6 01:10:39 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:         Net-MAC
-version:      1.3
+version:      1.4
 version_from: lib/Net/MAC.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libnet-mac-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/README?rev=19454&op=diff
==============================================================================
--- branches/upstream/libnet-mac-perl/current/README (original)
+++ branches/upstream/libnet-mac-perl/current/README Tue May  6 01:10:39 2008
@@ -146,6 +146,13 @@
               'delimiter' => '.'    # dot-delimited
       );
 
+    Note that if any of the above arguments are not provided, they will be
+    set to the following default values:
+
+     base       16
+     bit_group  8  (i.e. a delimiter will be used)
+     delimiter  :
+
   Conversion to common formats
     The most common formats have shortcut conversion methods that can be
     used instead of the convert() method with its many options.

Modified: branches/upstream/libnet-mac-perl/current/lib/Net/MAC.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/lib/Net/MAC.pm?rev=19454&op=diff
==============================================================================
--- branches/upstream/libnet-mac-perl/current/lib/Net/MAC.pm (original)
+++ branches/upstream/libnet-mac-perl/current/lib/Net/MAC.pm Tue May  6 01:10:39 2008
@@ -29,8 +29,8 @@
     'ne' => \&_compare_string_ne;
 
 # RCS ident string
-#my $rcs_id = '$Id: MAC.pm 139 2008-03-30 18:41:33Z oliver $';
-our $VERSION = '1.3';
+#my $rcs_id = '$Id: MAC.pm 157 2008-05-01 14:02:34Z oliver $';
+our $VERSION = '1.4';
 our $AUTOLOAD;
 
 # Constructor.
@@ -418,7 +418,7 @@
     my ( $self, %arg ) = @_;
     my $imac = $self->get_internal_mac();
     my @groups;
-    my $bit_group = $arg{'bit_group'} || 8;    # FIXME: ?
+    my $bit_group = $arg{'bit_group'} || 8; # not _default value
     my $offset = 0;
     use integer;
     my $size = $bit_group / 4;
@@ -456,6 +456,10 @@
 
         #warn "\nconvert groups @groups\n";
     }
+    elsif ($bit_group != 48) {
+        # use default delimiter
+        $mac_string = join( ':', @groups );
+    } 
     else {
         $mac_string = join( '', @groups );
     }
@@ -710,6 +714,13 @@
           'delimiter' => '.'    # dot-delimited
   );
 
+Note that if any of the above arguments are not provided, they will be set to
+the following default values:
+
+ base       16
+ bit_group  8  (i.e. a delimiter will be used)
+ delimiter  :
+
 =head2 Conversion to common formats
 
 The most common formats have shortcut conversion methods that can be used 

Added: branches/upstream/libnet-mac-perl/current/t/10_convert_args.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-mac-perl/current/t/10_convert_args.t?rev=19454&op=file
==============================================================================
--- branches/upstream/libnet-mac-perl/current/t/10_convert_args.t (added)
+++ branches/upstream/libnet-mac-perl/current/t/10_convert_args.t Tue May  6 01:10:39 2008
@@ -1,0 +1,20 @@
+# $Id: 10_convert_args.t 159 2008-05-01 14:04:31Z oliver $
+
+use Test::More tests => 5;
+#use Test::More qw(no_plan);
+BEGIN { use_ok('Net::MAC') };
+
+my $macaddr = '01:ab:01:ab:01:ab';
+
+my $mac = eval{ Net::MAC->new(mac => $macaddr) };
+isa_ok($mac, 'Net::MAC');
+
+my $mac_defaults = $mac->convert;
+is($mac_defaults, '01:ab:01:ab:01:ab', 'convert() using defaults');
+
+my $mac_bitgroup = $mac->convert(bit_group => 8);
+is($mac_bitgroup, '01:ab:01:ab:01:ab', 'convert() using bit_group and default delimiter');
+
+my $mac_bitgroup_delim = $mac->convert(bit_group => 12, delimiter => '-');
+is($mac_bitgroup_delim, '01a-b01-ab0-1ab', 'convert() using bit_group 12 and hyphen delimiter');
+




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