r62299 - in /trunk/libemail-address-perl: Changes META.yml README debian/changelog debian/copyright debian/patches/spelling.patch lib/Email/Address.pm t/tests.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sat Sep 4 15:14:24 UTC 2010


Author: ansgar-guest
Date: Sat Sep  4 15:14:04 2010
New Revision: 62299

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62299
Log:
* New upstream release, reverts to 1.889. (Closes: #595351)
* Update spelling.patch.
* debian/copyright: Refer to "Debian systems" instead of "Debian GNU/Linux
  systems".

Modified:
    trunk/libemail-address-perl/Changes
    trunk/libemail-address-perl/META.yml
    trunk/libemail-address-perl/README
    trunk/libemail-address-perl/debian/changelog
    trunk/libemail-address-perl/debian/copyright
    trunk/libemail-address-perl/debian/patches/spelling.patch
    trunk/libemail-address-perl/lib/Email/Address.pm
    trunk/libemail-address-perl/t/tests.t

Modified: trunk/libemail-address-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/Changes?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/Changes (original)
+++ trunk/libemail-address-perl/Changes Sat Sep  4 15:14:04 2010
@@ -1,4 +1,7 @@
 Release history for Email-Address
+
+1.892     2010-09-02
+          revert all behavior to 1.889
 
 1.891     2010-08-30
           rework domainless address feature to work on perl5.8 (Alex Vandiver)

Modified: trunk/libemail-address-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/META.yml?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/META.yml (original)
+++ trunk/libemail-address-perl/META.yml Sat Sep  4 15:14:04 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Email-Address
-version:            1.891
+version:            1.892
 abstract:           RFC 2822 Address Parsing
 author:
     - Casey West <casey at geeknest.com>

Modified: trunk/libemail-address-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/README?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/README (original)
+++ trunk/libemail-address-perl/README Sat Sep  4 15:14:04 2010
@@ -1,5 +1,5 @@
 NAME
-    Email::Address 1.891 - RFC 2822 Address Parsing and Creation
+    Email::Address 1.892 - RFC 2822 Address Parsing and Creation
 
 SYNOPSIS
       use Email::Address;

Modified: trunk/libemail-address-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/debian/changelog?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/debian/changelog (original)
+++ trunk/libemail-address-perl/debian/changelog Sat Sep  4 15:14:04 2010
@@ -1,9 +1,11 @@
-libemail-address-perl (1.891-1) UNRELEASED; urgency=low
+libemail-address-perl (1.892-1) unstable; urgency=low
 
-  IGNORE-VERSION: 1.891-1
-  Changes for perl 5.8
+  * New upstream release, reverts to 1.889. (Closes: #595351)
+  * Update spelling.patch.
+  * debian/copyright: Refer to "Debian systems" instead of "Debian GNU/Linux
+    systems".
 
- -- Ansgar Burchardt <ansgar at 43-1.org>  Tue, 31 Aug 2010 20:15:41 +0900
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Sun, 05 Sep 2010 00:03:31 +0900
 
 libemail-address-perl (1.890-1) unstable; urgency=low
 

Modified: trunk/libemail-address-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/debian/copyright?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/debian/copyright (original)
+++ trunk/libemail-address-perl/debian/copyright Sat Sep  4 15:14:04 2010
@@ -17,8 +17,8 @@
  This program is free software; you can redistribute it and/or modify
  it under the terms of the Artistic License, which comes with Perl.
  .
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'.
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
 
 License: GPL-1+
  This program is free software; you can redistribute it and/or modify
@@ -26,5 +26,5 @@
  the Free Software Foundation; either version 1, or (at your option)
  any later version.
  .
- On Debian GNU/Linux systems, the complete text of version 1 of the GNU
- General Public License can be found in `/usr/share/common-licenses/GPL-1'.
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.

Modified: trunk/libemail-address-perl/debian/patches/spelling.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/debian/patches/spelling.patch?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/debian/patches/spelling.patch (original)
+++ trunk/libemail-address-perl/debian/patches/spelling.patch Sat Sep  4 15:14:04 2010
@@ -6,7 +6,16 @@
 
 --- libemail-address-perl.orig/lib/Email/Address.pm
 +++ libemail-address-perl/lib/Email/Address.pm
-@@ -119,12 +119,12 @@
+@@ -36,7 +36,7 @@
+ 
+ This class implements a regex-based RFC 2822 parser that locates email
+ addresses in strings and returns a list of C<Email::Address> objects found.
+-Alternatley you may construct objects manually. The goal of this software is to
++Alternately you may construct objects manually. The goal of this software is to
+ be correct, and very very fast.
+ 
+ =cut
+@@ -120,12 +120,12 @@
  =item $Email::Address::name_addr
  
  This regular expression defines what an email address can look like
@@ -21,7 +30,7 @@
  following comment.
  
  =back
-@@ -334,7 +334,7 @@
+@@ -285,7 +285,7 @@
  
    Email::Address->disable_cache if memory_low();
  

Modified: trunk/libemail-address-perl/lib/Email/Address.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/lib/Email/Address.pm?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/lib/Email/Address.pm (original)
+++ trunk/libemail-address-perl/lib/Email/Address.pm Sat Sep  4 15:14:04 2010
@@ -1,16 +1,19 @@
 package Email::Address;
 use strict;
-#use warnings;
+## no critic RequireUseWarnings
+# support pre-5.6
+
+use vars qw[$VERSION $COMMENT_NEST_LEVEL $STRINGIFY
+            $COLLAPSE_SPACES
+            %PARSE_CACHE %FORMAT_CACHE %NAME_CACHE
+            $addr_spec $angle_addr $name_addr $mailbox];
 
 my $NOCACHE;
-my %PARSE_CACHE;
-my %FORMAT_CACHE;
-my %NAME_CACHE;
-
-our $VERSION              = '1.891';
-our $COMMENT_NEST_LEVEL ||= 2;
-our $STRINGIFY          ||= 'format';
-our $COLLAPSE_SPACES      = 1 unless defined $COLLAPSE_SPACES; # who wants //=? me!
+
+$VERSION              = '1.892';
+$COMMENT_NEST_LEVEL ||= 2;
+$STRINGIFY          ||= 'format';
+$COLLAPSE_SPACES      = 1 unless defined $COLLAPSE_SPACES; # who wants //=? me!
 
 =head1 NAME
 
@@ -27,13 +30,13 @@
 
 =head1 VERSION
 
-version 1.891
+version 1.892
 
 =head1 DESCRIPTION
 
 This class implements a regex-based RFC 2822 parser that locates email
 addresses in strings and returns a list of C<Email::Address> objects found.
-Alternately you may construct objects manually. The goal of this software is to
+Alternatley you may construct objects manually. The goal of this software is to
 be correct, and very very fast.
 
 =cut
@@ -68,18 +71,16 @@
 # to resolve bug 22991, creating a significant slowdown.  Given current speed
 # problems.  Once 16320 is resolved, this section should be dealt with.
 # -- rjbs, 2006-11-11
-#
-# XXX: ...and the first solution caused endless problems (never returned) when
+#my $obs_phrase     = qr/$word(?:$word|\.|$cfws)*/;
+
+# XXX: ...and the above solution caused endless problems (never returned) when
 # examining this address, now in a test:
 #   admin+=E6=96=B0=E5=8A=A0=E5=9D=A1_Weblog-- ATAT --test.socialtext.com
 # So we disallow the hateful CFWS in this context for now.  Of modern mail
 # agents, only Apple Web Mail 2.0 is known to produce obs-phrase.
 # -- rjbs, 2006-11-19
-my $obs_phrase;
-   $obs_phrase     = qr/$word(?:$word|\.|$cfws)*/;
-
 my $simple_word    = qr/$atom|\.|\s*"$qcontent+"\s*/;
-   $obs_phrase     = qr/$simple_word+/;
+my $obs_phrase     = qr/$simple_word+/;
 
 my $phrase         = qr/$obs_phrase|(?:$word+)/;
 
@@ -131,19 +132,10 @@
 
 =cut
 
-our $addr_spec  = qr/(?:$local_part\@$domain|$local_part)/;
-our $angle_addr = qr/$cfws*<$addr_spec>$cfws*/;
-our $name_addr  = qr/$display_name?$angle_addr/;
-our $mailbox    = qr/(?:$name_addr|$addr_spec)/;
-
-our $addr_spec_CRE  = qr/(?:($local_part)\@($domain)|($local_part))/;
-our $angle_addr_CRE = qr/$cfws*<$addr_spec_CRE>$cfws*/;
-our $name_addr_CRE  = qr/($display_name)?$angle_addr_CRE/;
-
-our $mailbox_list = qr/($mailbox)(?:,($mailbox))*/;
-our $group        = qr/$display_name\:/;
-our $address      = qr/$mailbox|$group/;
-our $address_list = qr/($address)(?:,($address))*/;
+$addr_spec  = qr/$local_part\@$domain/;
+$angle_addr = qr/$cfws*<$addr_spec>$cfws*/;
+$name_addr  = qr/$display_name?$angle_addr/;
+$mailbox    = qr/(?:$name_addr|$addr_spec)$comment*/;
 
 sub _PHRASE   () { 0 }
 sub _ADDRESS  () { 1 }
@@ -181,18 +173,6 @@
 prevent this behavior, set C<$Email::Address::COLLAPSE_SPACES> to zero.  This
 variable will go away when the bug is resolved properly.
 
-=item parse_allow_domainless
-
-  my @addrs = Email::Address->parse_allow_domainless(
-    q[me, Casey <me>, "Casey" <me> (West)]
-  );
-
-This method returns a list of C<Email::Address> objects it finds in
-the input string; it differs from :</parse> in that it allows
-"domainless" addresses, which lack an at-sign and domain name.  The
-domain of the addresses is presumed to be assumable by the calling
-code.
-
 =cut
 
 sub __get_cached_parse {
@@ -212,77 +192,48 @@
     $PARSE_CACHE{$line} = $addrs;
 }
 
-my $lead_tail_cfws = qr/(?:\A$cfws|$cfws\z)/;
-
-sub __parse {
-    my ($class, $line, $domainless) = @_;
+sub parse {
+    my ($class, $line) = @_;
     return unless $line;
 
     $line =~ s/[ \t]+/ /g if $COLLAPSE_SPACES;
 
-    my $key = "$domainless,$line";
-    if (my @cached = $class->__get_cached_parse($key)) {
+    if (my @cached = $class->__get_cached_parse($line)) {
         return @cached;
     }
 
-    $line =~ /\A($mailbox)/go;
-    my @mailboxes = $1;
-    push @mailboxes, $line =~ /\G,\s*($mailbox)/go;
-
+    my (@mailboxes) = ($line =~ /$mailbox/go);
     my @addrs;
-    MBOX: foreach (grep { defined } @mailboxes) {
-      # Strip comments.  Email address comments are the bane of every email
-      # address handler's day. -- rjbs, 2008-01-02
+    foreach (@mailboxes) {
+      my $original = $_;
+
       my @comments = /($comment)/go;
       s/$comment//go if @comments;
 
-      my ($phrase, $local_part, $domain);
-
-      if (/\A$addr_spec_CRE\z/o) {
-        $phrase     = '';
-        $local_part = defined $1 ? $1 : $3;
-        $domain     = defined $2 ? $2 : "";
-      } elsif (/\A$name_addr_CRE\z/o) {
-        $phrase     = defined $1 ? $1 : '';
-        $local_part = defined $2 ? $2 : $4;
-        $domain     = defined $3 ? $3 : "";
-      } else {
-        die "can't decypher $_";
+      my ($user, $host, $com);
+      ($user, $host) = ($1, $2) if s/<($local_part)\@($domain)>//o;
+      if (! defined($user) || ! defined($host)) {
+          s/($local_part)\@($domain)//o;
+          ($user, $host) = ($1, $2);
       }
-      last unless $domain or $domainless;
-
-      $phrase     =~ s/$lead_tail_cfws//go;
-      $local_part =~ s/$lead_tail_cfws//go;
-
-      my $original = $_;
-
-      my $all_comments = join q{ }, @comments;
-      $all_comments =~ s/(?:\A\s+|\s+\z)//go;
-
-      push @addrs, $class->new(
-        $phrase,
-        $domain ? "$local_part\@$domain" : $local_part,
-        $all_comments,
-        $original,
-      );
-
-      $addrs[-1]->[_IN_CACHE] = [ \$key, $#addrs ]
+
+      my ($phrase)       = /($display_name)/o;
+
+      for ( $phrase, $host, $user, @comments ) {
+        next unless defined $_;
+        s/^\s+//;
+        s/\s+$//;
+        $_ = undef unless length $_;
+      }
+
+      my $new_comment = join q{ }, @comments;
+      push @addrs,
+        $class->new($phrase, "$user\@$host", $new_comment, $original);
+      $addrs[-1]->[_IN_CACHE] = [ \$line, $#addrs ]
     }
 
-    $class->__cache_parse($key, \@addrs);
+    $class->__cache_parse($line, \@addrs);
     return @addrs;
-}
-
-sub parse {
-    my $self = shift;
-    my ($line) = @_;
-    return $self->__parse($line, 0);
-}
-
-sub parse_allow_domainless {
-    my $self = shift;
-    my ($line) = @_;
-    return $self->__parse($line, 1);
 }
 
 =pod
@@ -511,7 +462,7 @@
         $name =~ s/($quoted_pair)/substr $1, -1/goe;
         $name =~ s/$comment/ /go;
     } else {
-        ($name) = $self->[_ADDRESS] =~ /($local_part)(?:\@|\Z)/o;
+        ($name) = $self->[_ADDRESS] =~ /($local_part)\@/o;
     }
     $NAME_CACHE{"@{$_[0]}"} = $name;
 }

Modified: trunk/libemail-address-perl/t/tests.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-address-perl/t/tests.t?rev=62299&op=diff
==============================================================================
--- trunk/libemail-address-perl/t/tests.t (original)
+++ trunk/libemail-address-perl/t/tests.t Sat Sep  4 15:14:04 2010
@@ -678,7 +678,7 @@
     '"<advocacy-- ATAT --p.example.org>" <advocacy-- ATAT --p.example.org>',
     [
       [
-        '<advocacy-- ATAT --p.example.org>',
+        'advocacy',
         'advocacy-- ATAT --p.example.org',
         undef
       ]
@@ -1584,16 +1584,16 @@
       ]
     ]
   ],
-  [
-    'Jason W. May <jmay-- ATAT --x.example.com>',
-    [
-      [
-        'Jason W. May',
-        'jmay-- ATAT --x.example.com',
-        undef
-      ]
-    ]
-  ],
+  [ 
+    'Jason W. May <jmay-- ATAT --x.example.com>',                                   
+    [                                                                           
+      [                                                                         
+        'Jason W. May',                                                         
+        'jmay-- ATAT --x.example.com',                                              
+        undef                                                                   
+      ]                                                                         
+    ]                                                                           
+  ],                                                                            
   [
     '"Jason W. May" <jmay-- ATAT --x.example.com>, advocacy-- ATAT --p.example.org',
     [
@@ -1618,103 +1618,29 @@
         undef,
       ],
     ],
-  ],
-);
-
-my @domain_list = (@list,
-  [
-    'jibsheet',
-    [],
-  ],
-  [
-    'alexmv at example.com, jibsheet, jesse at example.com',
-    [
-      [
-        undef,
-        'alexmv-- ATAT --example.com',
-        undef,
-      ],
-    ],
-  ],
-);
-
-my @domainless_list = (@list,
-  [
-    'falcone',
-    [
-      [
-        undef,
-        'falcone',
-        undef
-      ],
-    ]
-  ],
-  [
-    'falcone, alexmv',
-    [
-      [
-        undef,
-        'falcone',
-        undef
-      ],
-      [
-        undef,
-        'alexmv',
-        undef
-      ],
-    ]
-  ],
-  [
-    'alexmv at example.com, jibsheet, jesse at example.com',
-    [
-      [
-        undef,
-        'alexmv-- ATAT --example.com',
-        undef,
-      ],
-      [
-        undef,
-        'jibsheet',
-        undef,
-      ],
-      [
-        undef,
-        'jesse-- ATAT --example.com',
-        undef,
-      ],
-    ],
-  ],
+  ]
 );
 
 my $tests = 1;
-   $tests += 1 + @{ $_->[1] } * 5 for @domain_list;
-   $tests += 1 + @{ $_->[1] } * 5 for @domainless_list;
+$tests += @{ $_->[1] } * 5 for @list;
 
 plan tests => $tests;
 
 use_ok 'Email::Address';
 
-for ([parse => \@domain_list], [parse_allow_domainless => \@domainless_list]) {
-    my ($method,$list) = @$_;
-    for (@$list) {
-        my ($string, $expect) = @$_;
+for (@list) {
+  $_->[0] =~ s/-- ATAT --/@/g;
+  my @addrs = Email::Address->parse($_->[0]);
+  my @tests =
+    map { Email::Address->new(map { $_ ? do {s/-- ATAT --/@/g; $_} : $_ } @$_) }
+    @{$_->[1]};
 
-        $string =~ s/-- ATAT --/@/g;
-        my @addrs = Email::Address->$method($string);
-
-        is(@addrs, @$expect, "got correct number of results from $method {$string}");
-
-        my @tests = map {
-            Email::Address->new(map { s/-- ATAT --/@/g if $_; $_ } @$_) }
-        @$expect;
-
-        foreach (@addrs) {
-            isa_ok($_, 'Email::Address');
-            my $test = shift @tests;
-            is($_->format,    $test->format, "format: " . $test->format);
-            is($_->as_string, $test->format, "format: " . $test->format);
-            is("$_",          $test->format, "stringify: $_");
-            is($_->name,      $test->name,   "name: " . $test->name);
-        }
-    }
+  foreach (@addrs) {
+      isa_ok($_, 'Email::Address');
+      my $test = shift @tests;
+      is($_->format,    $test->format, "format: " . $test->format);
+      is($_->as_string, $test->format, "format: " . $test->format);
+      is("$_",          $test->format, "stringify: $_");
+      is($_->name,      $test->name,   "name: " . $test->name);
+  }
 }




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