[Bps-public-commit] Net-IMAP-Server branch, master, updated. 1.16-3-gf499b2c
Alex M Vandiver
alexmv at bestpractical.com
Sun May 3 15:00:20 EDT 2009
The branch, master has been updated
via f499b2c68e60d333bb928b31674771bc03731f65 (commit)
from 69c81affdea001d0f3f2489484467892f2ba80eb (commit)
Summary of changes:
Changes | 4 +
META.yml | 8 ++-
SIGNATURE | 46 ++++++------
inc/Module/Install.pm | 111 ++++++++++++++++++++++------
inc/Module/Install/Base.pm | 60 +++++++++------
inc/Module/Install/Can.pm | 10 +--
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Makefile.pm | 39 +++++++---
inc/Module/Install/Metadata.pm | 158 +++++++++++++++++++++++++++++-----------
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 14 +++-
lib/Net/IMAP/Server.pm | 2 +-
12 files changed, 316 insertions(+), 140 deletions(-)
- Log -----------------------------------------------------------------
commit f499b2c68e60d333bb928b31674771bc03731f65
Author: Alex Vandiver <alexmv at mit.edu>
Date: Sun May 3 14:58:29 2009 -0400
1.17 releng
diff --git a/Changes b/Changes
index 89d4879..0ce4279 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
Revision history for Net-IMAP-Server
+1.17 Sun May 3 14:54:17 2009
+ * Document "NO" and "BAD" die() arguments
+ * Fix mailbox read-only attribute
+
1.16 Tue Apr 7 23:45:17 2009
* Make UID fetches no longer O(range client requested), which
is fragile when there are few messages but they are high in
diff --git a/META.yml b/META.yml
index 561968d..52b0a11 100644
--- a/META.yml
+++ b/META.yml
@@ -2,8 +2,12 @@
abstract: 'A single-threaded multiplexing IMAP server'
author:
- 'Alex Vandiver <alexmv at mit.edu>'
+build_requires:
+ ExtUtils::MakeMaker: 6.42
+configure_requires:
+ ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.79'
+generated_by: 'Module::Install version 0.85'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -29,4 +33,4 @@ requires:
UNIVERSAL::require: 0
resources:
license: http://dev.perl.org/licenses/
-version: 1.16
+version: 1.17
diff --git a/SIGNATURE b/SIGNATURE
index 13152b5..1610537 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -14,34 +14,34 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 82bf320fba2845b666739dbacbae897fcbd98fe2 Changes
+SHA1 0054ea38314614fd1e003ee92158b78694b1aa7d Changes
SHA1 1d36665e7d4a4a7a531de37b45e18fe4b9b4b412 MANIFEST
-SHA1 d95fe772635efb052f35381ee61e82870a98b17a META.yml
+SHA1 fcfdd7db70ce2b47454fb41f460dfddf3bf68556 META.yml
SHA1 bc012de893bb939fcbd66eeecc445b12f2ad1348 Makefile.PL
SHA1 f4c6e4793fd7815aec4abfcd69018d8f34d832a8 README
SHA1 f5333026061a6f347e7f2a3ce8bb6847081c200c certs/server-cert.pem
SHA1 4b963cd4c2b0a7e073241b4bac727cb6f96276f8 certs/server-key.pem
SHA1 49d9874a77ffba992404a926f33e77bb1f5b2629 ex/trivial-server.pl
-SHA1 ae018c4565c1277089ca8f1b28f888d95430cb7f inc/Module/Install.pm
-SHA1 4552acdfca8b78f8015d8449e1325616259095f5 inc/Module/Install/Base.pm
-SHA1 7fb663fff161fb45882b52edd62857bf15359658 inc/Module/Install/Can.pm
-SHA1 8b1d3db746faa6faf2d967a48d3812ec1f44b4c6 inc/Module/Install/Fetch.pm
-SHA1 9f6beaa2f4749ceb5dd0c9b0c647d0f3289c7b46 inc/Module/Install/Makefile.pm
-SHA1 7ad1da4fff7a1e7a634c9d734111c8292be08884 inc/Module/Install/Metadata.pm
-SHA1 e9aa83f3e8b16ccfce544a90a57b63b70a497759 inc/Module/Install/Win32.pm
-SHA1 ade2ac0b0246d4d8e28fa46942e53f6925abda46 inc/Module/Install/WriteAll.pm
-SHA1 6c668637be5500a9d5d963562280ce8b91b655be lib/Net/IMAP/Server.pm
+SHA1 18fcb6b27722fad5e465689f9622b03fd6b7d51c inc/Module/Install.pm
+SHA1 65bc57bf8257e3b66ec571850570626283ca659c inc/Module/Install/Base.pm
+SHA1 f76a19dff601776d6245f87936f0d2e9deb3c74d inc/Module/Install/Can.pm
+SHA1 ce92bd504500c543688fa12eb2ef6c832e9455e6 inc/Module/Install/Fetch.pm
+SHA1 c45b2672d8ae49d710343f39f68d00c28cba4b43 inc/Module/Install/Makefile.pm
+SHA1 82e172b951d97f74315af04cb7b909afa546fc07 inc/Module/Install/Metadata.pm
+SHA1 1b1de77b3187dfbbd6de905e539ff1393c1aa6a0 inc/Module/Install/Win32.pm
+SHA1 c1c96fa424457d79caaaf9af61037e6f984e71dc inc/Module/Install/WriteAll.pm
+SHA1 846bfba2df6c75d76fb9d9869914c93ea73bdeb4 lib/Net/IMAP/Server.pm
SHA1 e0016d978a1d896866cf27494ae9651d8af50311 lib/Net/IMAP/Server/Command.pm
SHA1 636e390f8f44ee6c51321220a44c20ceba08b44d lib/Net/IMAP/Server/Command/Append.pm
SHA1 5c203d47099444ceb8ce9e8927353d91ba0545cd lib/Net/IMAP/Server/Command/Authenticate.pm
SHA1 70f2aeb901dde845183ef6b70f56b4d777641a5d lib/Net/IMAP/Server/Command/Capability.pm
SHA1 de6607dec53f35b3b3fd41ad12191a83c59ae21b lib/Net/IMAP/Server/Command/Check.pm
-SHA1 589c12fc9d101b39261cd609cf3b3bd0202c62d4 lib/Net/IMAP/Server/Command/Close.pm
+SHA1 514b741e13d400a6c44215ab9bd66b77a16ef18c lib/Net/IMAP/Server/Command/Close.pm
SHA1 a73779c162243b7c0a0b8af6663f24533b044906 lib/Net/IMAP/Server/Command/Copy.pm
SHA1 65589737cc3fb5298ff42f10aed5ea9f103931b6 lib/Net/IMAP/Server/Command/Create.pm
SHA1 a4a9324f35403ed4ff483045fbe51081593ca50a lib/Net/IMAP/Server/Command/Delete.pm
SHA1 02746080dc893a9673d3ddd3b9d4bbca503b1203 lib/Net/IMAP/Server/Command/Examine.pm
-SHA1 0a8111233fd11a93c7306381dc7ca029a1006881 lib/Net/IMAP/Server/Command/Expunge.pm
+SHA1 e2a53e75f10e35e4935b807c202a10753c34ce4d lib/Net/IMAP/Server/Command/Expunge.pm
SHA1 6e8ba2d1fdfa02de45c595d9a5f8c2f444f36aaa lib/Net/IMAP/Server/Command/Fetch.pm
SHA1 fddb82fad844966a68d38270277c1c7acdb4e998 lib/Net/IMAP/Server/Command/Id.pm
SHA1 4f526e5a0d1b49e3a37632675980e14c687272ef lib/Net/IMAP/Server/Command/List.pm
@@ -52,25 +52,25 @@ SHA1 9184f034fb9e0ba9c504bd0954f3e02283c61b18 lib/Net/IMAP/Server/Command/Namesp
SHA1 78902aa13c8e79d5abc95fc6de637c1af8783ce2 lib/Net/IMAP/Server/Command/Noop.pm
SHA1 84adf33de0822b0357bd26f207db9812b655c85f lib/Net/IMAP/Server/Command/Rename.pm
SHA1 02fa261b0db9803737682e25721d0fe6625f0e29 lib/Net/IMAP/Server/Command/Search.pm
-SHA1 93320b7dd080eeb1d87fa17b2090fe59ed1695e4 lib/Net/IMAP/Server/Command/Select.pm
+SHA1 a6d47a6160d2899b33950a93f3d021666269e4f3 lib/Net/IMAP/Server/Command/Select.pm
SHA1 3e9a1813eb89b3c311ee61907c5cdc44a177f321 lib/Net/IMAP/Server/Command/Starttls.pm
SHA1 46d29fc4c67ee0e90ddf0a8d018bb8d1545856ed lib/Net/IMAP/Server/Command/Status.pm
-SHA1 5f525299848e3b91d093d3e301d01414b0fdacd1 lib/Net/IMAP/Server/Command/Store.pm
+SHA1 bd5fe7da9d541a86d5ae0072e85b1392196227f2 lib/Net/IMAP/Server/Command/Store.pm
SHA1 3fbb8ce46e696eeb62a97264cb564924a7ccfb57 lib/Net/IMAP/Server/Command/Subscribe.pm
-SHA1 c73f4ad4b6177c7efacca44f09b6629a35b63c04 lib/Net/IMAP/Server/Command/Uid.pm
+SHA1 c96f8962609ef8ce930e337a4f1d6dbb1a909a12 lib/Net/IMAP/Server/Command/Uid.pm
SHA1 4591be8d501ea8877f3b4d4418620cce094256ab lib/Net/IMAP/Server/Command/Unsubscribe.pm
-SHA1 581f96324ef9d5b023465fe84fef67447d57c087 lib/Net/IMAP/Server/Connection.pm
+SHA1 83e8e4e429715fba8a3e75aaf1f50bbbe98ee892 lib/Net/IMAP/Server/Connection.pm
SHA1 716c1bb33a3b970dfc80b2d19366b719a48caef3 lib/Net/IMAP/Server/DefaultAuth.pm
-SHA1 0f7b172c55ee7a7f378fd63a983b487cc01967f7 lib/Net/IMAP/Server/DefaultModel.pm
-SHA1 be062ebc3775a87c836ec3a2f0db2c69547d55a1 lib/Net/IMAP/Server/Mailbox.pm
+SHA1 9eea45b97044ad2d07db6b8959c6e41d60c550d5 lib/Net/IMAP/Server/DefaultModel.pm
+SHA1 92668acf271c99421140fe8684a91c2415a779b5 lib/Net/IMAP/Server/Mailbox.pm
SHA1 304b0d74141a70537b8c847acac806e18a966757 lib/Net/IMAP/Server/Message.pm
SHA1 2e67e318edc490da7367ebcc789d35d0810e00e6 t/00.load.t
SHA1 ec035a09e3f370620874e9c706d6c8ae4bdfa6a1 t/pod-coverage.t
SHA1 0190346d7072d458c8a10a45c19f86db641dcc48 t/pod.t
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.9 (GNU/Linux)
+Version: GnuPG v2.0.11 (GNU/Linux)
-iEYEARECAAYFAkncHkEACgkQMflWJZZAbqBLDQCbBWeUcq9HlfpJN99JARNmLJpj
-VXEAn0+/wtWn0xZ0Qbs/wo51mQk0DH9X
-=7h7p
+iEYEARECAAYFAkn96QkACgkQMflWJZZAbqDD6ACgkwvudjoz+NaLLzL25mYMW3z9
+8h8An0eSqjgqy3zOR/nVS3NgQK0ZT2kZ
+=9p9H
-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index b46be99..5b9ddbf 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,12 +17,10 @@ package Module::Install;
# 3. The ./inc/ version of Module::Install loads
# }
-BEGIN {
- require 5.004;
-}
+use 5.005;
use strict 'vars';
-use vars qw{$VERSION};
+use vars qw{$VERSION $MAIN};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
@@ -30,7 +28,10 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.79';
+ $VERSION = '0.85';
+
+ # Storage for the pseudo-singleton
+ $MAIN = undef;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -69,15 +70,26 @@ END_DIE
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
-if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
+if ( -f $0 ) {
+ my $s = (stat($0))[9];
+
+ # If the modification time is only slightly in the future,
+ # sleep briefly to remove the problem.
+ my $a = $s - time;
+ if ( $a > 0 and $a < 5 ) { sleep 5 }
+
+ # Too far in the future, throw an error.
+ my $t = time;
+ if ( $s > $t ) { die <<"END_DIE" }
-Your installer $0 has a modification time in the future.
+Your installer $0 has a modification time in the future ($s > $t).
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
+}
@@ -121,14 +133,22 @@ sub autoload {
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
- # delegate back to parent dirs
+ # Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unless ( uc($1) eq $1 ) {
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')};
+ my $method = $1;
+ if ( uc($method) eq $method ) {
+ # Do nothing
+ return;
+ } elsif ( $method =~ /^_/ and $self->can($method) ) {
+ # Dispatch to the root M:I class
+ return $self->$method(@_);
}
+
+ # Dispatch to the appropriate plugin
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
};
}
@@ -153,6 +173,9 @@ sub import {
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
+ # Save to the singleton
+ $MAIN = $self;
+
return 1;
}
@@ -166,8 +189,7 @@ sub preload {
my @exts = @{$self->{extensions}};
unless ( @exts ) {
- my $admin = $self->{admin};
- @exts = $admin->load_all_extensions;
+ @exts = $self->{admin}->load_all_extensions;
}
my %seen;
@@ -250,7 +272,7 @@ END_DIE
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -314,7 +336,7 @@ sub find_extensions {
#####################################################################
-# Utility Functions
+# Common Utility Functions
sub _caller {
my $depth = 0;
@@ -328,31 +350,70 @@ sub _caller {
sub _read {
local *FH;
- open FH, "< $_[0]" or die "open($_[0]): $!";
- my $str = do { local $/; <FH> };
+ if ( $] >= 5.006 ) {
+ open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+ } else {
+ open( FH, "< $_[0]" ) or die "open($_[0]): $!";
+ }
+ my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
- return $str;
+ return $string;
+}
+
+sub _readperl {
+ my $string = Module::Install::_read($_[0]);
+ $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+ $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
+ $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
+ return $string;
+}
+
+sub _readpod {
+ my $string = Module::Install::_read($_[0]);
+ $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
+ return $string if $_[0] =~ /\.pod\z/;
+ $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
+ $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
+ $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
+ $string =~ s/^\n+//s;
+ return $string;
}
sub _write {
local *FH;
- open FH, "> $_[0]" or die "open($_[0]): $!";
- foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
+ if ( $] >= 5.006 ) {
+ open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+ } else {
+ open( FH, "> $_[0]" ) or die "open($_[0]): $!";
+ }
+ foreach ( 1 .. $#_ ) {
+ print FH $_[$_] or die "print($_[0]): $!";
+ }
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
-
sub _version ($) {
my $s = shift || 0;
- $s =~ s/^(\d+)\.?//;
+ my $d =()= $s =~ /(\.)/g;
+ if ( $d >= 2 ) {
+ # Normalise multipart versions
+ $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
+ }
+ $s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
- my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g;
- $l = $l . '.' . join '', @v if @v;
+ my @v = map {
+ $_ . '0' x (3 - length $_)
+ } $s =~ /(\d{1,3})\D?/g;
+ $l = $l . '.' . join '', @v if @v;
return $l + 0;
}
+sub _cmp ($$) {
+ _version($_[0]) <=> _version($_[1]);
+}
+
# Cloned from Params::Util::_CLASS
sub _CLASS ($) {
(
@@ -360,7 +421,7 @@ sub _CLASS ($) {
and
! ref $_[0]
and
- $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
+ $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
) ? $_[0] : undef;
}
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 1145fe4..ac416c9 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -1,7 +1,11 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.79';
+use strict 'vars';
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '0.85';
+}
# Suspend handler for "redefined" warnings
BEGIN {
@@ -12,51 +16,61 @@ BEGIN {
### This is the ONLY module that shouldn't have strict on
# use strict;
-#line 41
+#line 45
sub new {
- my ($class, %args) = @_;
+ my ($class, %args) = @_;
- foreach my $method ( qw(call load) ) {
- *{"$class\::$method"} = sub {
- shift()->_top->$method(@_);
- } unless defined &{"$class\::$method"};
- }
+ foreach my $method ( qw(call load) ) {
+ next if defined &{"$class\::$method"};
+ *{"$class\::$method"} = sub {
+ shift()->_top->$method(@_);
+ };
+ }
- bless( \%args, $class );
+ bless( \%args, $class );
}
-#line 61
+#line 66
sub AUTOLOAD {
- my $self = shift;
- local $@;
- my $autoload = eval { $self->_top->autoload } or return;
- goto &$autoload;
+ my $self = shift;
+ local $@;
+ my $autoload = eval {
+ $self->_top->autoload
+ } or return;
+ goto &$autoload;
}
-#line 76
+#line 83
-sub _top { $_[0]->{_top} }
+sub _top {
+ $_[0]->{_top};
+}
-#line 89
+#line 98
sub admin {
- $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+ $_[0]->_top->{admin}
+ or
+ Module::Install::Base::FakeAdmin->new;
}
-#line 101
+#line 114
sub is_admin {
- $_[0]->admin->VERSION;
+ $_[0]->admin->VERSION;
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
-my $Fake;
-sub new { $Fake ||= bless(\@_, $_[0]) }
+my $fake;
+
+sub new {
+ $fake ||= bless(\@_, $_[0]);
+}
sub AUTOLOAD {}
@@ -69,4 +83,4 @@ BEGIN {
1;
-#line 146
+#line 162
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index ac81dec..3e2d523 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -3,15 +3,13 @@ package Module::Install::Can;
use strict;
use Module::Install::Base;
-use Config ();
-### This adds a 5.005 Perl version dependency.
-### This is a bug and will be fixed.
-use File::Spec ();
+use Config ();
+use File::Spec ();
use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -80,4 +78,4 @@ if ( $^O eq 'cygwin' ) {
__END__
-#line 158
+#line 156
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 41d9569..0a62208 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 689a4b7..2b80f0f 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -114,17 +114,32 @@ sub write {
my $self = shift;
die "&Makefile->write() takes no arguments\n" if @_;
- # Make sure we have a new enough
- require ExtUtils::MakeMaker;
+ # Check the current Perl version
+ my $perl_version = $self->perl_version;
+ if ( $perl_version ) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
+ }
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
+ # Make sure we have a new enough MakeMaker
+ require ExtUtils::MakeMaker;
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
+ # MakeMaker can complain about module versions that include
+ # an underscore, even though its own version may contain one!
+ # Hence the funny regexp to get rid of it. See RT #35800
+ # for details.
+ $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ } else {
+ # Allow legacy-compatibility with 5.005 by depending on the
+ # most recent EU:MM that supported 5.005.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ }
- # Generate the
+ # Generate the MakeMaker params
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -133,7 +148,7 @@ sub write {
if ( $self->tests ) {
$args->{test} = { TESTS => $self->tests };
}
- if ($] >= 5.005) {
+ if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
@@ -147,7 +162,7 @@ sub write {
delete $args->{SIGN};
}
- # merge both kinds of requires into prereq_pm
+ # Merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
map { @$_ }
@@ -250,4 +265,4 @@ sub postamble {
__END__
-#line 379
+#line 394
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 37d5eff..ca16db7 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -4,13 +4,18 @@ package Module::Install::Metadata;
use strict 'vars';
use Module::Install::Base;
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
- $ISCORE = 1;
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
+ $ISCORE = 1;
}
+my @boolean_keys = qw{
+ sign
+ mymeta
+};
+
my @scalar_keys = qw{
name
module_name
@@ -37,16 +42,43 @@ my @resource_keys = qw{
repository
};
+my @array_keys = qw{
+ keywords
+};
+
sub Meta { shift }
+sub Meta_BooleanKeys { @boolean_keys }
sub Meta_ScalarKeys { @scalar_keys }
sub Meta_TupleKeys { @tuple_keys }
sub Meta_ResourceKeys { @resource_keys }
+sub Meta_ArrayKeys { @array_keys }
+
+foreach my $key ( @boolean_keys ) {
+ *$key = sub {
+ my $self = shift;
+ if ( defined wantarray and not @_ ) {
+ return $self->{values}->{$key};
+ }
+ $self->{values}->{$key} = ( @_ ? $_[0] : 1 );
+ return $self;
+ };
+}
foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
- return $self->{values}{$key} if defined wantarray and !@_;
- $self->{values}{$key} = shift;
+ return $self->{values}->{$key} if defined wantarray and !@_;
+ $self->{values}->{$key} = shift;
+ return $self;
+ };
+}
+
+foreach my $key ( @array_keys ) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}->{$key} if defined wantarray and !@_;
+ $self->{values}->{$key} ||= [];
+ push @{$self->{values}->{$key}}, @_;
return $self;
};
}
@@ -55,12 +87,12 @@ foreach my $key ( @resource_keys ) {
*$key = sub {
my $self = shift;
unless ( @_ ) {
- return () unless $self->{values}{resources};
+ return () unless $self->{values}->{resources};
return map { $_->[1] }
grep { $_->[0] eq $key }
- @{ $self->{values}{resources} };
+ @{ $self->{values}->{resources} };
}
- return $self->{values}{resources}{$key} unless @_;
+ return $self->{values}->{resources}->{$key} unless @_;
my $uri = shift or die(
"Did not provide a value to $key()"
);
@@ -69,17 +101,17 @@ foreach my $key ( @resource_keys ) {
};
}
-foreach my $key ( grep {$_ ne "resources"} @tuple_keys) {
+foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
*$key = sub {
my $self = shift;
- return $self->{values}{$key} unless @_;
+ return $self->{values}->{$key} unless @_;
my @added;
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
push @added, [ $module, $version ];
}
- push @{ $self->{values}{$key} }, @added;
+ push @{ $self->{values}->{$key} }, @added;
return map {@$_} @added;
};
}
@@ -100,29 +132,22 @@ sub resources {
if ( $name eq lc $name and ! $lc_resource{$name} ) {
die("Unsupported reserved lowercase resource '$name'");
}
- $self->{values}{resources} ||= [];
- push @{ $self->{values}{resources} }, [ $name, $value ];
+ $self->{values}->{resources} ||= [];
+ push @{ $self->{values}->{resources} }, [ $name, $value ];
}
- $self->{values}{resources};
+ $self->{values}->{resources};
}
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
-sub test_requires { shift->build_requires(@_) }
-sub install_requires { shift->build_requires(@_) }
+sub test_requires { shift->build_requires(@_) }
+sub install_requires { shift->build_requires(@_) }
# Aliases for installdirs options
-sub install_as_core { $_[0]->installdirs('perl') }
-sub install_as_cpan { $_[0]->installdirs('site') }
-sub install_as_site { $_[0]->installdirs('site') }
-sub install_as_vendor { $_[0]->installdirs('vendor') }
-
-sub sign {
- my $self = shift;
- return $self->{values}{sign} if defined wantarray and ! @_;
- $self->{values}{sign} = ( @_ ? $_[0] : 1 );
- return $self;
-}
+sub install_as_core { $_[0]->installdirs('perl') }
+sub install_as_cpan { $_[0]->installdirs('site') }
+sub install_as_site { $_[0]->installdirs('site') }
+sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
my $self = shift;
@@ -130,13 +155,13 @@ sub dynamic_config {
warn "You MUST provide an explicit true/false value to dynamic_config\n";
return $self;
}
- $self->{values}{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
return 1;
}
sub perl_version {
my $self = shift;
- return $self->{values}{perl_version} unless @_;
+ return $self->{values}->{perl_version} unless @_;
my $version = shift or die(
"Did not provide a value to perl_version()"
);
@@ -149,20 +174,41 @@ sub perl_version {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
- $self->{values}{perl_version} = $version;
+ $self->{values}->{perl_version} = $version;
}
+#Stolen from M::B
+my %license_urls = (
+ perl => 'http://dev.perl.org/licenses/',
+ apache => 'http://apache.org/licenses/LICENSE-2.0',
+ artistic => 'http://opensource.org/licenses/artistic-license.php',
+ artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
+ lgpl => 'http://opensource.org/licenses/lgpl-license.php',
+ lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
+ lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
+ bsd => 'http://opensource.org/licenses/bsd-license.php',
+ gpl => 'http://opensource.org/licenses/gpl-license.php',
+ gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
+ gpl3 => 'http://opensource.org/licenses/gpl-3.0.html',
+ mit => 'http://opensource.org/licenses/mit-license.php',
+ mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
+ open_source => undef,
+ unrestricted => undef,
+ restrictive => undef,
+ unknown => undef,
+);
+
sub license {
my $self = shift;
- return $self->{values}{license} unless @_;
+ return $self->{values}->{license} unless @_;
my $license = shift or die(
'Did not provide a value to license()'
);
- $self->{values}{license} = $license;
+ $self->{values}->{license} = $license;
# Automatically fill in license URLs
- if ( $license eq 'perl' ) {
- $self->resources( license => 'http://dev.perl.org/licenses/' );
+ if ( $license_urls{$license} ) {
+ $self->resources( license => $license_urls{$license} );
}
return 1;
@@ -204,7 +250,7 @@ sub all_from {
sub provides {
my $self = shift;
- my $provides = ( $self->{values}{provides} ||= {} );
+ my $provides = ( $self->{values}->{provides} ||= {} );
%$provides = (%$provides, @_) if @_;
return $provides;
}
@@ -233,7 +279,7 @@ sub auto_provides {
sub feature {
my $self = shift;
my $name = shift;
- my $features = ( $self->{values}{features} ||= [] );
+ my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
@@ -261,16 +307,16 @@ sub features {
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return $self->{values}{features}
- ? @{ $self->{values}{features} }
+ return $self->{values}->{features}
+ ? @{ $self->{values}->{features} }
: ();
}
sub no_index {
my $self = shift;
my $type = shift;
- push @{ $self->{values}{no_index}{$type} }, @_ if $type;
- return $self->{values}{no_index};
+ push @{ $self->{values}->{no_index}->{$type} }, @_ if $type;
+ return $self->{values}->{no_index};
}
sub read {
@@ -423,10 +469,18 @@ sub license_from {
return 'unknown';
}
+sub _extract_bugtracker {
+ my @links = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+ my %links;
+ @links{@links}=();
+ @links=keys %links;
+ return @links;
+}
+
sub bugtracker_from {
my $self = shift;
my $content = Module::Install::_read($_[0]);
- my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
+ my @links = _extract_bugtracker($content);
unless ( @links ) {
warn "Cannot determine bugtracker info from $_[0]\n";
return 0;
@@ -441,6 +495,17 @@ sub bugtracker_from {
return 1;
}
+sub requires_from {
+ my $self = shift;
+ my $content = Module::Install::_readperl($_[0]);
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ while ( @requires ) {
+ my $module = shift @requires;
+ my $version = shift @requires;
+ $self->requires( $module => $version );
+ }
+}
+
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Also, convert double-part versions (eg, 5.8)
@@ -464,7 +529,7 @@ sub _perl_version {
# MYMETA.yml Support
sub WriteMyMeta {
- $_[0]->write_mymeta;
+ die "WriteMyMeta has been deprecated";
}
sub write_mymeta {
@@ -473,6 +538,11 @@ sub write_mymeta {
# If there's no existing META.yml there is nothing we can do
return unless -f 'META.yml';
+ # We need YAML::Tiny to write the MYMETA.yml file
+ unless ( eval { require YAML::Tiny; 1; } ) {
+ return 1;
+ }
+
# Merge the perl version into the dependencies
my $val = $self->Meta->{values};
my $perl = delete $val->{perl_version};
@@ -488,7 +558,6 @@ sub write_mymeta {
}
# Load the advisory META.yml file
- require YAML::Tiny;
my @yaml = YAML::Tiny::LoadFile('META.yml');
my $meta = $yaml[0];
@@ -504,7 +573,8 @@ sub write_mymeta {
}
# Save as the MYMETA.yml file
- YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+ print "Writing MYMETA.yml\n";
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 2bd721a..c00da94 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 3819d78..df3900a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.79';
+ $VERSION = '0.85';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
@@ -22,7 +22,6 @@ sub WriteAll {
);
$self->sign(1) if $args{sign};
- $self->Meta->write if $args{meta};
$self->admin->WriteAll(%args) if $self->is_admin;
$self->check_nmake if $args{check_nmake};
@@ -30,11 +29,22 @@ sub WriteAll {
$self->makemaker_args( PL_FILES => {} );
}
+ # Until ExtUtils::MakeMaker support MYMETA.yml, make sure
+ # we clean it up properly ourself.
+ $self->realclean_files('MYMETA.yml');
+
if ( $args{inline} ) {
$self->Inline->write;
} else {
$self->Makefile->write;
}
+
+ # The Makefile write process adds a couple of dependencies,
+ # so write the META.yml files after the Makefile.
+ $self->Meta->write if $args{meta};
+ $self->Meta->write_mymeta if $self->mymeta;
+
+ return 1;
}
1;
diff --git a/lib/Net/IMAP/Server.pm b/lib/Net/IMAP/Server.pm
index 9591174..5e80991 100644
--- a/lib/Net/IMAP/Server.pm
+++ b/lib/Net/IMAP/Server.pm
@@ -8,7 +8,7 @@ use base qw/Net::Server::Coro Class::Accessor/;
use UNIVERSAL::require;
use Coro;
-our $VERSION = '1.16';
+our $VERSION = '1.17';
=head1 NAME
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list