r42461 - in /branches/upstream/libmail-imapclient-perl/current: Changes MANIFEST META.yml lib/Mail/IMAPClient.pm t/simple.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Aug 22 12:42:06 UTC 2009


Author: jawnsy-guest
Date: Sat Aug 22 12:42:00 2009
New Revision: 42461

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=42461
Log:
[svn-upgrade] Integrating new upstream version, libmail-imapclient-perl (3.20)

Added:
    branches/upstream/libmail-imapclient-perl/current/t/simple.t
Modified:
    branches/upstream/libmail-imapclient-perl/current/Changes
    branches/upstream/libmail-imapclient-perl/current/MANIFEST
    branches/upstream/libmail-imapclient-perl/current/META.yml
    branches/upstream/libmail-imapclient-perl/current/lib/Mail/IMAPClient.pm

Modified: branches/upstream/libmail-imapclient-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmail-imapclient-perl/current/Changes?rev=42461&op=diff
==============================================================================
--- branches/upstream/libmail-imapclient-perl/current/Changes (original)
+++ branches/upstream/libmail-imapclient-perl/current/Changes Sat Aug 22 12:42:00 2009
@@ -4,6 +4,15 @@
 Changes from 2.99_01 to 3.16    made by Mark Overmeer
 Changes from 0.09    to 2.99_01 made by David Kernen
 	- Potential compatibility issues from 3.17+ highlighted with '*'
+
+version 3.20: Fri Aug 21 17:40:40 EDT 2009
+	- added file/tests in t/simple.t
+	- added methods Rfc3501_date/Rfc3501_datetime
+	  used by deprecated methods Rfc2060_date/Rfc2060_datetime
+	  rt.cpan.org#48510: Rfc3501_date/Rfc3501_datetime methods do
+	    not exist [sedmonds]
+	- login() hack to quote an empty password
+	  rt.cpan.org#48107: Cannot LOGIN with empty password [skunk]
 
 version 3.19: Fri Jun 19 14:59:15 EDT 2009
 	- *search() backwards compat: caller must quote single arg properly

Modified: branches/upstream/libmail-imapclient-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmail-imapclient-perl/current/MANIFEST?rev=42461&op=diff
==============================================================================
--- branches/upstream/libmail-imapclient-perl/current/MANIFEST (original)
+++ branches/upstream/libmail-imapclient-perl/current/MANIFEST Sat Aug 22 12:42:00 2009
@@ -34,6 +34,7 @@
 t/bodystructure.t
 t/messageset.t
 t/pod.t
+t/simple.t
 t/thread.t
 test_template.txt
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: branches/upstream/libmail-imapclient-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmail-imapclient-perl/current/META.yml?rev=42461&op=diff
==============================================================================
--- branches/upstream/libmail-imapclient-perl/current/META.yml (original)
+++ branches/upstream/libmail-imapclient-perl/current/META.yml Sat Aug 22 12:42:00 2009
@@ -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:         Mail-IMAPClient
-version:      3.19
+version:      3.20
 version_from: lib/Mail/IMAPClient.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libmail-imapclient-perl/current/lib/Mail/IMAPClient.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmail-imapclient-perl/current/lib/Mail/IMAPClient.pm?rev=42461&op=diff
==============================================================================
--- branches/upstream/libmail-imapclient-perl/current/lib/Mail/IMAPClient.pm (original)
+++ branches/upstream/libmail-imapclient-perl/current/lib/Mail/IMAPClient.pm Sat Aug 22 12:42:00 2009
@@ -5,7 +5,7 @@
 use warnings;
 
 package Mail::IMAPClient;
-our $VERSION = '3.19';
+our $VERSION = '3.20';
 
 use Mail::IMAPClient::MessageSet;
 
@@ -139,10 +139,11 @@
 my @mnt = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 
 sub Rfc822_date {
-    my $class = shift;    #Date: Fri, 09 Jul 1999 13:10:55 -0000#
+    my $class = shift;
     my $date = $class =~ /^\d+$/ ? $class : shift;    # method or function?
-    my @date = gmtime $date;
-
+    my @date = gmtime($date);
+
+    #Date: Fri, 09 Jul 1999 13:10:55 -0000
     sprintf(
         "%s, %02d %s %04d %02d:%02d:%02d -%04d",
         $dow[ $date[6] ],
@@ -154,19 +155,29 @@
 }
 
 # The following methods create valid dates for use in IMAP search strings
+# - provide Rfc2060* methods/functions for backwards compatibility
 sub Rfc2060_date {
-    my $class = shift;                                 # 11-Jan-2000
-    my $stamp = $class =~ /^\d+$/ ? $class : shift;    # method or function
-    my @date  = gmtime $stamp;
-
+    $_[0] =~ /^\d+$/ ? Rfc3501_date(@_) : shift->Rfc3501_date(@_);
+}
+sub Rfc3501_date {
+    my $class = shift;
+    my $stamp = $class =~ /^\d+$/ ? $class : shift;
+    my @date  = gmtime($stamp);
+
+    # 11-Jan-2000
     sprintf( "%02d-%s-%04d", $date[3], $mnt[ $date[4] ], $date[5] + 1900 );
 }
 
 sub Rfc2060_datetime($;$) {
-    my ( $class, $stamp, $zone ) = @_;    # 11-Jan-2000 04:04:04 +0000
-    $zone ||= '+0000';
-    my @date = gmtime $stamp;
-
+    $_[0] =~ /^\d+$/ ? Rfc3501_datetime(@_) : shift->Rfc3501_datetime(@_);
+}
+sub Rfc3501_datetime($;$) {
+    my $class = shift;
+    my $stamp = $class =~ /^\d+$/ ? $class : shift;
+    my $zone  = shift || '+0000';
+    my @date  = gmtime($stamp);
+
+    # 11-Jan-2000 04:04:04 +0000
     sprintf(
         "%02d-%s-%04d %02d:%02d:%02d %s",
         $date[3],
@@ -367,7 +378,8 @@
 
     return undef unless ( defined($passwd) and defined($id) );
 
-    if ( $passwd =~ m/\W/ ) {    # need to quote
+    # BUG: should use Quote() with $passwd and $id
+    if ( $passwd eq "" or $passwd =~ m/\W/ ) {
         $passwd =~ s/(["\\])/\\$1/g;
         $passwd = qq("$passwd");
     }

Added: branches/upstream/libmail-imapclient-perl/current/t/simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmail-imapclient-perl/current/t/simple.t?rev=42461&op=file
==============================================================================
--- branches/upstream/libmail-imapclient-perl/current/t/simple.t (added)
+++ branches/upstream/libmail-imapclient-perl/current/t/simple.t Sat Aug 22 12:42:00 2009
@@ -1,0 +1,36 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More tests => 13;
+
+BEGIN { use_ok('Mail::IMAPClient') or exit; }
+
+{
+    my $obj = Mail::IMAPClient->new();
+
+    my %t = ( 0 => "01-Jan-1970" );
+    foreach my $k ( sort keys %t ) {
+        my $v = $t{$k};
+        my $s = $v . ' 00:00:00 +0000';
+
+        is( Mail::IMAPClient::Rfc2060_date($k), $v, "Rfc2060_date($k)=$v" );
+        is( Mail::IMAPClient::Rfc3501_date($k), $v, "Rfc3501_date($k)=$v" );
+        is( Mail::IMAPClient::Rfc3501_datetime($k),
+            $s, "Rfc3501_datetime($k)=$s" );
+        is( Mail::IMAPClient::Rfc2060_datetime($k),
+            $s, "Rfc3501_datetime($k)=$s" );
+        is( $obj->Rfc3501_date($k),     $v, "->Rfc3501_date($k)=$v" );
+        is( $obj->Rfc2060_date($k),     $v, "->Rfc2060_date($k)=$v" );
+        is( $obj->Rfc3501_datetime($k), $s, "->Rfc3501_datetime($k)=$s" );
+        is( $obj->Rfc2060_datetime($k), $s, "->Rfc2060_datetime($k)=$s" );
+
+        foreach my $z (qw(+0000 -0500)) {
+            my $vz = $v . ' 00:00:00 ' . $z;
+            is( Mail::IMAPClient::Rfc2060_datetime( $k, $z ),
+                $vz, "Rfc2060_datetime($k)=$vz" );
+            is( Mail::IMAPClient::Rfc3501_datetime( $k, $z ),
+                $vz, "Rfc3501_datetime($k)=$vz" );
+        }
+    }
+}




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