Skip to content
This repository
Browse code

Release 0.34

  • Loading branch information...
commit 44d5334c4f3f4d00870a0f1d5188af5b89cf354b 1 parent fac4a92
Graham Barr authored February 10, 2007
15  MANIFEST
@@ -40,6 +40,21 @@ data/slapd-conf.in
40 40
 data/slapd.at.conf
41 41
 data/slapd.oc.conf
42 42
 data/slapd2-conf.in
  43
+inc/ExtUtils/AutoInstall.pm
  44
+inc/Module/AutoInstall.pm
  45
+inc/Module/Install.pm
  46
+inc/Module/Install/AutoInstall.pm
  47
+inc/Module/Install/Base.pm
  48
+inc/Module/Install/Can.pm
  49
+inc/Module/Install/Fetch.pm
  50
+inc/Module/Install/Include.pm
  51
+inc/Module/Install/Makefile.pm
  52
+inc/Module/Install/Metadata.pm
  53
+inc/Module/Install/Win32.pm
  54
+inc/Module/Install/WriteAll.pm
  55
+inc/Test/Builder.pm
  56
+inc/Test/Builder/Module.pm
  57
+inc/Test/More.pm
43 58
 INSTALL
44 59
 install-nomake
45 60
 lib/Bundle/Net/LDAP.pm
19  META.yml
... ...
@@ -0,0 +1,19 @@
  1
+abstract: LDAP client library
  2
+author: 'Graham Barr <gbarr@cpan.org>'
  3
+distribution_type: module
  4
+generated_by: Module::Install version 0.64
  5
+license: perl
  6
+module_name: Net::LDAP
  7
+name: perl-ldap
  8
+no_index:
  9
+  directory:
  10
+    - inc
  11
+    - t
  12
+recommends:
  13
+  Digest::HMAC_MD5: 0
  14
+  Digest::MD5: 0
  15
+  GSSAPI: 0
  16
+requires:
  17
+  Convert::ASN1: 0.07
  18
+  perl: 5.004
  19
+version: 0.34
148  SIGNATURE
... ...
@@ -0,0 +1,148 @@
  1
+This file contains message digests of all files listed in MANIFEST,
  2
+signed via the Module::Signature module, version 0.55.
  3
+
  4
+To verify the content in this distribution, first make sure you have
  5
+Module::Signature installed, then type:
  6
+
  7
+    % cpansign -v
  8
+
  9
+It will check each file's integrity, as well as the signature's
  10
+validity.  If "==> Signature verified OK! <==" is not displayed,
  11
+the distribution may already have been compromised, and you should
  12
+not run its Makefile.PL or Build.PL.
  13
+
  14
+-----BEGIN PGP SIGNED MESSAGE-----
  15
+Hash: SHA1
  16
+
  17
+SHA1 d0b391ea67d4af1e877c4476490c95cf3f8783e6 CREDITS
  18
+SHA1 2d7f2f3057ff910b25bd9a24e924945626322ac4 Changes
  19
+SHA1 18422f27b2f17b10e9d18b4e482d7bfc95c8df86 INSTALL
  20
+SHA1 ae98c540c35e53fab3790a54a6a66ab774896989 MANIFEST
  21
+SHA1 5f397c3ff8e8bbbeac18f22babaab96d0ab3b829 META.yml
  22
+SHA1 1055526a79cf595b2e803897bc7e03bf26a33f98 Makefile.PL
  23
+SHA1 f3b66414a0872801f3c4c38a93499d0fe48509ef README
  24
+SHA1 6c5729e4c6bb46c66fcc33dbb8231292d1c14dee TODO
  25
+SHA1 8e15e7abefa826736358685aa1115810baaa9b4a bin/ldapdelete
  26
+SHA1 fb042e706fb1f873b39138c95b8f362a8f1bea8d bin/ldapmodrdn
  27
+SHA1 212b83f5dae352596008329dc6bfac445a3ab4ac bin/ldapsearch
  28
+SHA1 84b1e62a1fd089e1c0f9c3210ab368804f338854 contrib/README
  29
+SHA1 a74eca9ed266c3bf2280744a3c05aecaaf0c222a contrib/dot.tklkup
  30
+SHA1 c1528100aa9eae5d5e98f778820e83af7c584fa2 contrib/isMember.pl
  31
+SHA1 1b11ae1f3e5cde0d577988fd8936c4895e0c6096 contrib/jpegDisplay.pl
  32
+SHA1 45be5e0f79345b5e55e8b1b97c25615c8b43d547 contrib/jpegLoad.pl
  33
+SHA1 848646da05eed8b27cb7d498cfb421ed1a67a5c5 contrib/ldapmodify.pl
  34
+SHA1 ed46c80d99a70d1516dba41e396b369cad078800 contrib/ldifdiff.pl
  35
+SHA1 eb6932a765ae6f1ba47f75b1919dd1335cbb82f8 contrib/ldifsort.pl
  36
+SHA1 9823ffdc3c2d75d0d4af5f3c1ec60bf6e8c5e037 contrib/ldifuniq.pl
  37
+SHA1 eacb3515921f5843240603f949c83e3b1c1f725e contrib/printMembers.pl
  38
+SHA1 6950da15067e5b7c27bfb29158ebdbd503eb3485 contrib/recursive-ldap-delete.pl
  39
+SHA1 df87a8de85e4952f48325c4d8d218b7ec46ccb6b contrib/simple-proxy.pl
  40
+SHA1 78fa4fa862022ff06c612b5620c0f802b9c7b5a7 contrib/tklkup
  41
+SHA1 6294227b00010f90afc17c2c6f114a0ef7610c15 data/00-cmp.ldif
  42
+SHA1 1739c30b959c46cf0402447f79a555235b7992e7 data/00-cmp2.ldif
  43
+SHA1 25488cd6943fc31cdce5dcc57e2ab0e71b0af6fa data/00-in.ldif
  44
+SHA1 cbe464de69d6ce8cdd685a6c974cadefa30f59e4 data/05-cmp.dsml
  45
+SHA1 b09b216730801f2e87ac6477209b9880d01760e2 data/50-cmp.ldif
  46
+SHA1 cb80f6c7512155ef78e088c2bc646c060e6b28a6 data/50-in.ldif
  47
+SHA1 75ead7bee1a193df0d85b1213ce7598b8f9ceebf data/51-in.ldif
  48
+SHA1 6a9339527895ab398bc6815ef5252113d058c5b1 data/51a-cmp.ldif
  49
+SHA1 c34bd74218e43344518270a127a84b147b611c54 data/51b-cmp.ldif
  50
+SHA1 8255138264d063dd6d6278e71517a971ba0fd580 data/51c-cmp.ldif
  51
+SHA1 bcc285bb208851e7d4af035bea125398e9c2f9e1 data/51d-cmp.ldif
  52
+SHA1 c670c8e8355c04e4de1b7f4b20171766c792508c data/52-cmp.ldif
  53
+SHA1 78d94c1241c06e7b747546d68bcef89f0bdc25d9 data/52-in.ldif
  54
+SHA1 fdf3c652989ce5d07f776dd62e2c1126fd9c8f21 data/52-mod.ldif
  55
+SHA1 ac61c547d11a0a9cb4760a970ab05893d56ec82a data/cert.pem
  56
+SHA1 a4e840b79efa92f097601c973e943a983d9b9d53 data/core.schema
  57
+SHA1 56633628a6bc7fd702b26a5a28b453e0ab1085bf data/cosine.schema
  58
+SHA1 b8e188b49f792ba2dc34593002917d3d9cf8fcab data/inetorgperson.schema
  59
+SHA1 61a41c6ade1933ac44408205fd0bd129d98eae2a data/key.pem
  60
+SHA1 8142bb403781334bf95ca07e807673bae1528e9a data/schema.in
  61
+SHA1 b88f0a3a70d3e7f2273cc0747dc090fe5c000efa data/slapd-conf.in
  62
+SHA1 452b956531f884178323c9c2fd975bea711749b5 data/slapd.at.conf
  63
+SHA1 bcbeffecb030cabedb950ad002560aadce17bab3 data/slapd.oc.conf
  64
+SHA1 6c43ebd79740ee71ccfba5bbf23c96d95182cfaa data/slapd2-conf.in
  65
+SHA1 5b52cbdabc56a44e4c0a90a3f5a5609a90d26f84 inc/ExtUtils/AutoInstall.pm
  66
+SHA1 603bb9de29fb8cba7f13409c546750972eff645d inc/Module/AutoInstall.pm
  67
+SHA1 9b2f9d83bcf77860f53a0c07c90a4a59ad9f5df1 inc/Module/Install.pm
  68
+SHA1 ad955f51ad2c40d4ba35395c27f5ed899a80bf7a inc/Module/Install/AutoInstall.pm
  69
+SHA1 abe32855d75ab13747cf65765af9947b7a8c3057 inc/Module/Install/Base.pm
  70
+SHA1 95b81d1e91bd634467bf633571eff4420e9c04eb inc/Module/Install/Can.pm
  71
+SHA1 1fe98c63cf9d7271c8cb4183ba230f152df69e26 inc/Module/Install/Fetch.pm
  72
+SHA1 0606a8b02a420600bc3e2b65ab82f70266784926 inc/Module/Install/Include.pm
  73
+SHA1 2249171a2b72cd73ff2c0a06597d29f86e5df456 inc/Module/Install/Makefile.pm
  74
+SHA1 381bb98ea3877bba49ae85e7a7ea130645fd3dbf inc/Module/Install/Metadata.pm
  75
+SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
  76
+SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
  77
+SHA1 f0ebc594cf8ba858ee9a840c344d9b7ea2c3c6f4 inc/Test/Builder.pm
  78
+SHA1 a9037004a2c3096d77169a16da95743eeb813539 inc/Test/Builder/Module.pm
  79
+SHA1 07c750f370de7a44ee7b0ed9ec30a7e89c24c9b9 inc/Test/More.pm
  80
+SHA1 4dde3f6e30c239c15c234309b7c32dd5a7d409a9 install-nomake
  81
+SHA1 da956a83d04192b551118b6ddffc32977cff5427 lib/Bundle/Net/LDAP.pm
  82
+SHA1 3637699c1d2e0427a74aa5e44ef0f61a725a83f4 lib/LWP/Protocol/ldap.pm
  83
+SHA1 4bf65450c343173391af0fd1f86003e986c98fd3 lib/Net/LDAP.pm
  84
+SHA1 17531c1124abb3380305c07eec1030fb7c0f6562 lib/Net/LDAP.pod
  85
+SHA1 29bc52aaf9188f020c0c7c38bb83427c25e45560 lib/Net/LDAP/ASN.pm
  86
+SHA1 ebfde82b7edff4ede462aa52e25c9518fc680965 lib/Net/LDAP/Bind.pm
  87
+SHA1 8afd6ebc4e7c0635407c785a54a0cf49dcc96e8d lib/Net/LDAP/Constant.pm
  88
+SHA1 75fdd7f9a2a2c72cebb8f2752e092b0b76255b2d lib/Net/LDAP/Control.pm
  89
+SHA1 ab3a966de9724b2ce4197757fec087a766bb4a09 lib/Net/LDAP/Control/EntryChange.pm
  90
+SHA1 f2db11b80336a47c8bc5a1ebeb2ad0228838275c lib/Net/LDAP/Control/ManageDsaIT.pm
  91
+SHA1 409330c198b6459bffdb78761ce22a300417337e lib/Net/LDAP/Control/Paged.pm
  92
+SHA1 28e53a53f254fbee4f8b71ab311f9ca833007f59 lib/Net/LDAP/Control/PersistentSearch.pm
  93
+SHA1 7171701e5043314e5ce026847fb42111065af2ec lib/Net/LDAP/Control/ProxyAuth.pm
  94
+SHA1 ffd5e5f5035b4aa5b3c64f018791e338a4c98372 lib/Net/LDAP/Control/Sort.pm
  95
+SHA1 9e0e84ea6eb7cefd13caa9788a3ffa24c8017d4d lib/Net/LDAP/Control/SortResult.pm
  96
+SHA1 bccc55cb200ec061790cef7420dff28e0c15eb54 lib/Net/LDAP/Control/VLV.pm
  97
+SHA1 bb9ff3dde55d0f40d69a51db611c113abe994247 lib/Net/LDAP/Control/VLVResponse.pm
  98
+SHA1 3aa62f4c9ce94ead75f633a7fa1ced2a2bf9f4dc lib/Net/LDAP/DSML.pm
  99
+SHA1 8fb55b34b0d80d900fbde88bbf9f97021ecca62a lib/Net/LDAP/Entry.pm
  100
+SHA1 3c37f02d65c91899942d1b2c5f3342e4107bba48 lib/Net/LDAP/Entry.pod
  101
+SHA1 f9a7c3e2ad3e9398c7c142ce6e015af2a7060f17 lib/Net/LDAP/Examples.pod
  102
+SHA1 e52b67753bb12fd61d10cab20905fdb390361283 lib/Net/LDAP/Extension.pm
  103
+SHA1 61301677c081a6c2afa4bd39250d3d50fd2047bf lib/Net/LDAP/Extension/SetPassword.pm
  104
+SHA1 e701488dfea2250b60bf1a5e58d556ab173f57a8 lib/Net/LDAP/Extension/WhoAmI.pm
  105
+SHA1 1d0e9a195cec05800c9ad9d4fcb2d567bf4dc116 lib/Net/LDAP/Extra.pm
  106
+SHA1 ff4ff38435edd72be15178a7afceb486a560a804 lib/Net/LDAP/FAQ.pod
  107
+SHA1 9509f50030b3609b993117ce8f9dc00231343002 lib/Net/LDAP/Filter.pm
  108
+SHA1 56ff107733bf97c57b339f78e4525719689dccac lib/Net/LDAP/Filter.pod
  109
+SHA1 7e541bc6e29f1148f75d8f47f888c2716b57d294 lib/Net/LDAP/FilterMatch.pm
  110
+SHA1 3840767e0f208525c5a198afad7e4451f09e7f61 lib/Net/LDAP/LDIF.pm
  111
+SHA1 1d7a8fe4b67ae48442093db02639e64fad008e21 lib/Net/LDAP/LDIF.pod
  112
+SHA1 1d09a48226227327fc052d32ffd7196bec160794 lib/Net/LDAP/Message.pm
  113
+SHA1 6a8b2d30a43d6295de37771c2576cb66c7f10bfd lib/Net/LDAP/Message.pod
  114
+SHA1 1ae5e4d10afff9f5d6cd8262a294db331fb461d5 lib/Net/LDAP/RFC.pod
  115
+SHA1 4921a9eb85f595aaa4c5c2bf7261feae54440763 lib/Net/LDAP/Reference.pod
  116
+SHA1 f06325e3a75f69792014a762919c1fcf90ab7d78 lib/Net/LDAP/RootDSE.pm
  117
+SHA1 91b9629d67cc2fe12689e4a9b42cba658fc206fd lib/Net/LDAP/Schema.pm
  118
+SHA1 4e23323449b264e98257c4bc257aaa454469386b lib/Net/LDAP/Schema.pod
  119
+SHA1 5e21676536b08a6382a9b361c50f8e24e6b0e144 lib/Net/LDAP/Search.pm
  120
+SHA1 15021444c87d36bbb22755766c0554ef7f633165 lib/Net/LDAP/Search.pod
  121
+SHA1 118c4b8e7f937fa5e9abe1cb2bfff9e7d8445471 lib/Net/LDAP/Security.pod
  122
+SHA1 19892d74ed36da101a9060e0de2915ed2a4da28d lib/Net/LDAP/Util.pm
  123
+SHA1 06f526f6bc250ab6b9749c4fe402b2ed20b88b31 lib/Net/LDAPI.pm
  124
+SHA1 ccc12f936613216c1dd5ed191df950e9364075ac lib/Net/LDAPS.pm
  125
+SHA1 75969973755cde2af99389a5cc654ac70d4fb89a t/00ldif-entry.t
  126
+SHA1 4e1601ad167d1db136af53d42aaa9242099ab8d0 t/01canon_dn.t
  127
+SHA1 67604a71b08d134734b07e9f5971bff62ad8bd46 t/02filter.t
  128
+SHA1 6afb905b4d8583a2f3dbeef2068cc953dffe7c25 t/03schema.t
  129
+SHA1 9b58a5eb0ec7b9ef4cb3c79d63704f986359b2ed t/04refloop.t
  130
+SHA1 3432e1c4dad5504ae2909f9069683f3425fe866e t/05dsml.t
  131
+SHA1 77b30ffef2402f438cf57a9af95f0358d50bb27e t/50populate.t
  132
+SHA1 60962ef635db1ddf1da912cdd063611fb9181846 t/51search.t
  133
+SHA1 c648f686d6fc03332fdebaef1705fb0d0c87ee94 t/52modify.t
  134
+SHA1 c342a60369e2c9ab024a3dbc05b9b7f24e611256 t/53schema.t
  135
+SHA1 74f6707bcfcd97fd8f765148aea2e7647d4193fb t/54dse.t
  136
+SHA1 0ca00731c9955275b80ab84539a094e361c9ba56 t/55ssl.t
  137
+SHA1 78620427839f55c27f33f32e56239f01aadcb6be t/56ipc.t
  138
+SHA1 b5f9fbf8baa8ddd9d97331037725d183ef856ae0 t/57url.t
  139
+SHA1 a564d8de4711120f62f8dd8e472b04fe340f50c8 t/70sortctrl.t
  140
+SHA1 6a00f8ca8ee8fd12a89e0f7304d7f09650893cfa t/common.pl
  141
+SHA1 5fc1dc6f5ec7a7ef372585f154f3c9a6020d3134 test.cfg
  142
+-----BEGIN PGP SIGNATURE-----
  143
+Version: GnuPG v1.4.6 (GNU/Linux)
  144
+
  145
+iD8DBQFFzlnPR0BL4gbYw3QRAslzAJ9OAkaY34co+lySaS97nd2dAu579ACeIx0S
  146
+70ZTKS/ZxAT8cNRS76SloR4=
  147
+=33tF
  148
+-----END PGP SIGNATURE-----
647  inc/ExtUtils/AutoInstall.pm
... ...
@@ -0,0 +1,647 @@
  1
+#line 1
  2
+package ExtUtils::AutoInstall;
  3
+$ExtUtils::AutoInstall::VERSION = '0.63';
  4
+
  5
+use strict;
  6
+use Cwd ();
  7
+use ExtUtils::MakeMaker ();
  8
+
  9
+#line 311
  10
+
  11
+# special map on pre-defined feature sets
  12
+my %FeatureMap = (
  13
+    ''      => 'Core Features', # XXX: deprecated
  14
+    '-core' => 'Core Features',
  15
+);
  16
+
  17
+# various lexical flags
  18
+my (@Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS);
  19
+my ($Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly);
  20
+my ($PostambleActions, $PostambleUsed);
  21
+
  22
+_accept_default(!-t STDIN); # see if it's a non-interactive session
  23
+_init();
  24
+
  25
+sub _accept_default {
  26
+    $AcceptDefault = shift;
  27
+}
  28
+
  29
+sub missing_modules {
  30
+    return @Missing;
  31
+}
  32
+
  33
+sub do_install {
  34
+    __PACKAGE__->install(
  35
+        [ UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}],
  36
+        @Missing,
  37
+    );
  38
+}
  39
+
  40
+# initialize various flags, and/or perform install
  41
+sub _init {
  42
+    foreach my $arg (@ARGV, split(/[\s\t]+/, $ENV{PERL_EXTUTILS_AUTOINSTALL} || '')) {
  43
+        if ($arg =~ /^--config=(.*)$/) {
  44
+            $Config = [ split(',', $1) ];
  45
+        }
  46
+        elsif ($arg =~ /^--installdeps=(.*)$/) {
  47
+            __PACKAGE__->install($Config, @Missing = split(/,/, $1));
  48
+            exit 0;
  49
+        }
  50
+        elsif ($arg =~ /^--default(?:deps)?$/) {
  51
+            $AcceptDefault = 1;
  52
+        }
  53
+        elsif ($arg =~ /^--check(?:deps)?$/) {
  54
+            $CheckOnly = 1;
  55
+        }
  56
+        elsif ($arg =~ /^--skip(?:deps)?$/) {
  57
+            $SkipInstall = 1;
  58
+        }
  59
+        elsif ($arg =~ /^--test(?:only)?$/) {
  60
+            $TestOnly = 1;
  61
+        }
  62
+    }
  63
+}
  64
+
  65
+# overrides MakeMaker's prompt() to automatically accept the default choice
  66
+sub _prompt {
  67
+    goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
  68
+
  69
+    my ($prompt, $default) = @_;
  70
+    my $y = ($default =~ /^[Yy]/);
  71
+
  72
+    print $prompt, ' [', ($y ? 'Y' : 'y'), '/', ($y ? 'n' : 'N'), '] ';
  73
+    print "$default\n";
  74
+    return $default;
  75
+}
  76
+
  77
+# the workhorse
  78
+sub import {
  79
+    my $class = shift;
  80
+    my @args  = @_ or return;
  81
+    my $core_all;
  82
+
  83
+    print "*** $class version ".$class->VERSION."\n";
  84
+    print "*** Checking for dependencies...\n";
  85
+
  86
+    my $cwd = Cwd::cwd();
  87
+
  88
+    $Config  = [];
  89
+
  90
+    my $maxlen = length((sort { length($b) <=> length($a) }
  91
+        grep { /^[^\-]/ }
  92
+        map { ref($_) ? keys %{ref($_) eq 'HASH' ? $_ : +{@{$_}}} : '' }
  93
+        map { +{@args}->{$_} }
  94
+        grep { /^[^\-]/ or /^-core$/i } keys %{+{@args}})[0]);
  95
+
  96
+    while (my ($feature, $modules) = splice(@args, 0, 2)) {
  97
+        my (@required, @tests, @skiptests);
  98
+        my $default  = 1;
  99
+        my $conflict = 0;
  100
+
  101
+        if ($feature =~ m/^-(\w+)$/) {
  102
+            my $option = lc($1);
  103
+
  104
+            # check for a newer version of myself
  105
+            _update_to($modules, @_) and return if $option eq 'version';
  106
+
  107
+            # sets CPAN configuration options
  108
+            $Config = $modules                  if $option eq 'config';
  109
+
  110
+            # promote every features to core status
  111
+            $core_all = ($modules =~ /^all$/i) and next
  112
+                if $option eq 'core';
  113
+
  114
+            next unless $option eq 'core';
  115
+        }
  116
+
  117
+        print "[".($FeatureMap{lc($feature)} || $feature)."]\n";
  118
+
  119
+        $modules = [ %{$modules} ] if UNIVERSAL::isa($modules, 'HASH');
  120
+
  121
+        unshift @$modules, -default => &{shift(@$modules)}
  122
+            if (ref($modules->[0]) eq 'CODE'); # XXX: bugward combatability
  123
+
  124
+        while (my ($mod, $arg) = splice(@$modules, 0, 2)) {
  125
+            if ($mod =~ m/^-(\w+)$/) {
  126
+                my $option = lc($1);
  127
+
  128
+                $default   = $arg    if ($option eq 'default');
  129
+                $conflict  = $arg    if ($option eq 'conflict');
  130
+                @tests     = @{$arg} if ($option eq 'tests');
  131
+                @skiptests = @{$arg} if ($option eq 'skiptests');
  132
+
  133
+                next;
  134
+            }
  135
+
  136
+            printf("- %-${maxlen}s ...", $mod);
  137
+
  138
+            # XXX: check for conflicts and uninstalls(!) them.
  139
+            if (defined(my $cur = _version_check(_load($mod), $arg ||= 0))) {
  140
+                print "loaded. ($cur".($arg ? " >= $arg" : '').")\n";
  141
+                push @Existing, $mod => $arg;
  142
+                $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  143
+            }
  144
+            else {
  145
+                print "missing." . ($arg ? " (would need $arg)" : '') . "\n";
  146
+                push @required, $mod => $arg;
  147
+            }
  148
+        }
  149
+
  150
+        next unless @required;
  151
+
  152
+        my $mandatory = ($feature eq '-core' or $core_all);
  153
+
  154
+        if (!$SkipInstall and ($CheckOnly or _prompt(
  155
+            qq{==> Auto-install the }. (@required / 2).
  156
+            ($mandatory ? ' mandatory' : ' optional').
  157
+            qq{ module(s) from CPAN?}, $default ? 'y' : 'n',
  158
+        ) =~ /^[Yy]/)) {
  159
+            push (@Missing, @required);
  160
+            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  161
+        }
  162
+
  163
+        elsif (!$SkipInstall and $default and $mandatory and _prompt(
  164
+            qq{==> The module(s) are mandatory! Really skip?}, 'n',
  165
+        ) =~ /^[Nn]/) {
  166
+            push (@Missing, @required);
  167
+            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  168
+        }
  169
+
  170
+        else {
  171
+            $DisabledTests{$_} = 1 for map { glob($_) } @tests;
  172
+        }
  173
+    }
  174
+
  175
+    _check_lock(); # check for $UnderCPAN
  176
+
  177
+    if (@Missing and not ($CheckOnly or $UnderCPAN)) {
  178
+        require Config;
  179
+        print "*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
  180
+        # make an educated guess of whether we'll need root permission.
  181
+        print "    (You may need to do that as the 'root' user.)\n" if eval '$>';
  182
+    }
  183
+    print "*** $class configuration finished.\n";
  184
+
  185
+    chdir $cwd;
  186
+
  187
+    # import to main::
  188
+    no strict 'refs';
  189
+    *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
  190
+}
  191
+
  192
+# CPAN.pm is non-reentrant, so check if we're under it and have no CPANPLUS
  193
+sub _check_lock {
  194
+    return unless @Missing;
  195
+    return if _has_cpanplus();
  196
+
  197
+    require CPAN; CPAN::Config->load;
  198
+    my $lock = MM->catfile($CPAN::Config->{cpan_home}, ".lock");
  199
+
  200
+    if (-f $lock and open(LOCK, $lock)
  201
+        and ($^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid())
  202
+        and ($CPAN::Config->{prerequisites_policy} || '') ne 'ignore'
  203
+    ) {
  204
+        print << '.';
  205
+
  206
+*** Since we're running under CPAN, I'll just let it take care
  207
+    of the dependency's installation later.
  208
+.
  209
+        $UnderCPAN = 1;
  210
+    }
  211
+
  212
+    close LOCK;
  213
+}
  214
+
  215
+sub install {
  216
+    my $class  = shift;
  217
+
  218
+    my $i; # used below to strip leading '-' from config keys
  219
+    my @config = (map { s/^-// if ++$i; $_ } @{+shift});
  220
+
  221
+    my (@modules, @installed);
  222
+    while (my ($pkg, $ver) = splice(@_, 0, 2)) {
  223
+        # grep out those already installed
  224
+        if (defined(_version_check(_load($pkg), $ver))) {
  225
+            push @installed, $pkg;
  226
+        }
  227
+        else {
  228
+            push @modules, $pkg, $ver;
  229
+        }
  230
+    }
  231
+
  232
+    return @installed unless @modules; # nothing to do
  233
+
  234
+    print "*** Installing dependencies...\n";
  235
+
  236
+    return unless _connected_to('cpan.org');
  237
+
  238
+    my %args = @config;
  239
+    my %failed;
  240
+    local *FAILED;
  241
+    if ($args{do_once} and open(FAILED, '.#autoinstall.failed')) {
  242
+        while (<FAILED>) { chomp; $failed{$_}++ }
  243
+        close FAILED;
  244
+
  245
+        my @newmod;
  246
+        while (my ($k, $v) = splice(@modules, 0, 2)) {
  247
+            push @newmod, ($k => $v) unless $failed{$k};
  248
+        }
  249
+        @modules = @newmod;
  250
+    }
  251
+
  252
+    if (_has_cpanplus()) {
  253
+        _install_cpanplus(\@modules, \@config);
  254
+    }
  255
+    else {
  256
+        _install_cpan(\@modules, \@config);
  257
+    }
  258
+
  259
+    print "*** $class installation finished.\n";
  260
+
  261
+    # see if we have successfully installed them
  262
+    while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
  263
+        if (defined(_version_check(_load($pkg), $ver))) {
  264
+            push @installed, $pkg;
  265
+        }
  266
+        elsif ($args{do_once} and open(FAILED, '>> .#autoinstall.failed')) {
  267
+            print FAILED "$pkg\n";
  268
+        }
  269
+    }
  270
+
  271
+    close FAILED if $args{do_once};
  272
+
  273
+    return @installed;
  274
+}
  275
+
  276
+sub _install_cpanplus {
  277
+    my @modules = @{+shift};
  278
+    my @config  = @{+shift};
  279
+    my $installed = 0;
  280
+
  281
+    require CPANPLUS::Backend;
  282
+    my $cp   = CPANPLUS::Backend->new;
  283
+    my $conf = $cp->configure_object;
  284
+
  285
+    return unless _can_write(
  286
+        $conf->can('conf')
  287
+            ? $conf->get_conf('base')       # 0.05x+
  288
+            : $conf->_get_build('base')     # 0.04x
  289
+    );
  290
+
  291
+    # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
  292
+    my $makeflags = $conf->get_conf('makeflags') || '';
  293
+    if (UNIVERSAL::isa($makeflags, 'HASH')) {
  294
+        # 0.03+ uses a hashref here
  295
+        $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
  296
+    }
  297
+    else {
  298
+        # 0.02 and below uses a scalar
  299
+        $makeflags = join(' ', split(' ', $makeflags), 'UNINST=1')
  300
+            if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
  301
+    }
  302
+    $conf->set_conf(makeflags => $makeflags);
  303
+    $conf->set_conf(prereqs => 1);
  304
+
  305
+    while (my ($key, $val) = splice(@config, 0, 2)) {
  306
+        eval { $conf->set_conf($key, $val) };
  307
+    }
  308
+
  309
+    my $modtree = $cp->module_tree;
  310
+    while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
  311
+        print "*** Installing $pkg...\n";
  312
+
  313
+        MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
  314
+
  315
+        my $success;
  316
+        my $obj = $modtree->{$pkg};
  317
+
  318
+        if ($obj and defined(_version_check($obj->{version}, $ver))) {
  319
+            my $pathname = $pkg; $pathname =~ s/::/\\W/;
  320
+
  321
+            foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
  322
+                delete $INC{$inc};
  323
+            }
  324
+
  325
+            my $rv = $cp->install( modules => [ $obj->{module} ]);
  326
+
  327
+            if ($rv and ($rv->{$obj->{module}} or $rv->{ok})) {
  328
+                print "*** $pkg successfully installed.\n";
  329
+                $success = 1;
  330
+            }
  331
+            else {
  332
+                print "*** $pkg installation cancelled.\n";
  333
+                $success = 0;
  334
+            }
  335
+
  336
+            $installed += $success;
  337
+        }
  338
+        else {
  339
+            print << ".";
  340
+*** Could not find a version $ver or above for $pkg; skipping.
  341
+.
  342
+        }
  343
+
  344
+        MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
  345
+    }
  346
+
  347
+    return $installed;
  348
+}
  349
+
  350
+sub _install_cpan {
  351
+    my @modules = @{+shift};
  352
+    my @config  = @{+shift};
  353
+    my $installed = 0;
  354
+    my %args;
  355
+
  356
+    require CPAN; CPAN::Config->load;
  357
+    require Config;
  358
+
  359
+    return unless _can_write(MM->catfile($CPAN::Config->{cpan_home}, 'sources'))
  360
+              and _can_write($Config::Config{sitelib});
  361
+
  362
+    # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
  363
+    my $makeflags = $CPAN::Config->{make_install_arg} || '';
  364
+    $CPAN::Config->{make_install_arg} = join(' ', split(' ', $makeflags), 'UNINST=1')
  365
+        if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
  366
+
  367
+    # don't show start-up info
  368
+    $CPAN::Config->{inhibit_startup_message} = 1;
  369
+
  370
+    # set additional options
  371
+    while (my ($opt, $arg) = splice(@config, 0, 2)) {
  372
+        ($args{$opt} = $arg, next)
  373
+            if $opt =~ /^force$/; # pseudo-option
  374
+        $CPAN::Config->{$opt} = $arg;
  375
+    }
  376
+
  377
+    local $CPAN::Config->{prerequisites_policy} = 'follow';
  378
+
  379
+    while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
  380
+        MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
  381
+
  382
+        print "*** Installing $pkg...\n";
  383
+
  384
+        my $obj = CPAN::Shell->expand(Module => $pkg);
  385
+        my $success = 0;
  386
+
  387
+        if ($obj and defined(_version_check($obj->cpan_version, $ver))) {
  388
+            my $pathname = $pkg; $pathname =~ s/::/\\W/;
  389
+
  390
+            foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
  391
+                delete $INC{$inc};
  392
+            }
  393
+
  394
+            $obj->force('install') if $args{force};
  395
+
  396
+            my $rv = $obj->install || eval { 
  397
+                $CPAN::META->instance(
  398
+                    'CPAN::Distribution',
  399
+                    $obj->cpan_file,
  400
+                )->{install} if $CPAN::META
  401
+            };
  402
+
  403
+            if ($rv eq 'YES') {
  404
+                print "*** $pkg successfully installed.\n";
  405
+                $success = 1;
  406
+            }
  407
+            else {
  408
+                print "*** $pkg installation failed.\n";
  409
+                $success = 0;
  410
+            }
  411
+
  412
+            $installed += $success;
  413
+        }
  414
+        else {
  415
+            print << ".";
  416
+*** Could not find a version $ver or above for $pkg; skipping.
  417
+.
  418
+        }
  419
+
  420
+        MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
  421
+    }
  422
+
  423
+    return $installed;
  424
+}
  425
+
  426
+sub _has_cpanplus {
  427
+    return (
  428
+        $HasCPANPLUS = (
  429
+            $INC{'CPANPLUS/Config.pm'} or
  430
+            _load('CPANPLUS::Shell::Default')
  431
+        )
  432
+    );
  433
+}
  434
+
  435
+# make guesses on whether we're under the CPAN installation directory
  436
+sub _under_cpan {
  437
+    require Cwd;
  438
+    require File::Spec;
  439
+
  440
+    my $cwd  = File::Spec->canonpath(Cwd::cwd());
  441
+    my $cpan = File::Spec->canonpath($CPAN::Config->{cpan_home});
  442
+
  443
+    return (index($cwd, $cpan) > -1);
  444
+}
  445
+
  446
+sub _update_to {
  447
+    my $class = __PACKAGE__;
  448
+    my $ver   = shift;
  449
+
  450
+    return if defined(_version_check(_load($class), $ver)); # no need to upgrade
  451
+
  452
+    if (_prompt(
  453
+        "==> A newer version of $class ($ver) is required. Install?", 'y'
  454
+    ) =~ /^[Nn]/) {
  455
+        die "*** Please install $class $ver manually.\n";
  456
+    }
  457
+
  458
+    print << ".";
  459
+*** Trying to fetch it from CPAN...
  460
+.
  461
+
  462
+    # install ourselves
  463
+    _load($class) and return $class->import(@_)
  464
+        if $class->install([], $class, $ver);
  465
+
  466
+    print << '.'; exit 1;
  467
+
  468
+*** Cannot bootstrap myself. :-( Installation terminated.
  469
+.
  470
+}
  471
+
  472
+# check if we're connected to some host, using inet_aton
  473
+sub _connected_to {
  474
+    my $site = shift;
  475
+
  476
+    return (
  477
+        ( _load('Socket') and Socket::inet_aton($site) ) or _prompt(qq(
  478
+*** Your host cannot resolve the domain name '$site', which
  479
+    probably means the Internet connections are unavailable.
  480
+==> Should we try to install the required module(s) anyway?), 'n'
  481
+        ) =~ /^[Yy]/
  482
+    );
  483
+}
  484
+
  485
+# check if a directory is writable; may create it on demand
  486
+sub _can_write {
  487
+    my $path = shift;
  488
+    mkdir ($path, 0755) unless -e $path;
  489
+
  490
+    return 1 if -w $path;
  491
+
  492
+    print << ".";
  493
+*** You are not allowed to write to the directory '$path';
  494
+    the installation may fail due to insufficient permissions.
  495
+.
  496
+
  497
+    if (eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(qq(
  498
+==> Should we try to re-execute the autoinstall process with 'sudo'?), 'y'
  499
+    ) =~ /^[Yy]/) {
  500
+        # try to bootstrap ourselves from sudo
  501
+        print << ".";
  502
+*** Trying to re-execute the autoinstall process with 'sudo'...
  503
+.
  504
+        my $missing = join(',', @Missing);
  505
+        my $config  = join(',',
  506
+            UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
  507
+        ) if $Config;
  508
+
  509
+        return unless system('sudo', $^X, $0, "--config=$config", "--installdeps=$missing");
  510
+
  511
+        print << ".";
  512
+*** The 'sudo' command exited with error!  Resuming...
  513
+.
  514
+    }
  515
+
  516
+    return _prompt(qq(
  517
+==> Should we try to install the required module(s) anyway?), 'n'
  518
+    ) =~ /^[Yy]/
  519
+}
  520
+
  521
+# load a module and return the version it reports
  522
+sub _load {
  523
+    my $mod = pop; # class/instance doesn't matter
  524
+    my $file = $mod;
  525
+
  526
+    $file =~ s|::|/|g;
  527
+    $file .= '.pm';
  528
+
  529
+    local $@;
  530
+    return eval { require $file; $mod->VERSION } || ($@ ? undef : 0);
  531
+}
  532
+
  533
+# compare two versions, either use Sort::Versions or plain comparison
  534
+sub _version_check {
  535
+    my ($cur, $min) = @_;
  536
+    return unless defined $cur;
  537
+
  538
+    $cur =~ s/\s+$//;
  539
+
  540
+    # check for version numbers that are not in decimal format
  541
+    if (ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./) {
  542
+        if ($version::VERSION or defined(_load('version'))) {
  543
+            # use version.pm if it is installed.
  544
+            return ((version->new($cur) >= version->new($min)) ? $cur : undef);
  545
+        }
  546
+        elsif ($Sort::Versions::VERSION or defined(_load('Sort::Versions'))) {
  547
+            # use Sort::Versions as the sorting algorithm for a.b.c versions
  548
+            return ((Sort::Versions::versioncmp($cur, $min) != -1) ? $cur : undef);
  549
+        }
  550
+
  551
+        warn "Cannot reliably compare non-decimal formatted versions.\n".
  552
+             "Please install version.pm or Sort::Versions.\n";
  553
+    }
  554
+
  555
+    # plain comparison
  556
+    local $^W = 0; # shuts off 'not numeric' bugs
  557
+    return ($cur >= $min ? $cur : undef);
  558
+}
  559
+
  560
+# nothing; this usage is deprecated.
  561
+sub main::PREREQ_PM { return {}; }
  562
+
  563
+sub _make_args {
  564
+    my %args = @_;
  565
+
  566
+    $args{PREREQ_PM} = { %{$args{PREREQ_PM} || {} }, @Existing, @Missing }
  567
+        if $UnderCPAN or $TestOnly;
  568
+
  569
+    if ($args{EXE_FILES}) {
  570
+        require ExtUtils::Manifest;
  571
+        my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
  572
+
  573
+        $args{EXE_FILES} = [
  574
+            grep { exists $manifest->{$_} } @{$args{EXE_FILES}}
  575
+        ];
  576
+    }
  577
+
  578
+    $args{test}{TESTS} ||= 't/*.t';
  579
+    $args{test}{TESTS} = join(' ', grep {
  580
+        !exists($DisabledTests{$_})
  581
+    } map { glob($_) } split(/\s+/, $args{test}{TESTS}));
  582
+
  583
+    my $missing = join(',', @Missing);
  584
+    my $config  = join(',',
  585
+        UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
  586
+    ) if $Config;
  587
+
  588
+    $PostambleActions = (
  589
+        $missing ? "\$(PERL) $0 --config=$config --installdeps=$missing"
  590
+                 : "\@\$(NOOP)"
  591
+    );
  592
+
  593
+    return %args;
  594
+}
  595
+
  596
+# a wrapper to ExtUtils::MakeMaker::WriteMakefile
  597
+sub Write {
  598
+    require Carp;
  599
+    Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
  600
+
  601
+    if ($CheckOnly) {
  602
+        print << ".";
  603
+*** Makefile not written in check-only mode.
  604
+.
  605
+        return;
  606
+    }
  607
+
  608
+    my %args = _make_args(@_);
  609
+
  610
+    no strict 'refs';
  611
+
  612
+    $PostambleUsed = 0;
  613
+    local *MY::postamble = \&postamble unless defined &MY::postamble;
  614
+    ExtUtils::MakeMaker::WriteMakefile(%args);
  615
+
  616
+    print << "." unless $PostambleUsed;
  617
+*** WARNING: Makefile written with customized MY::postamble() without
  618
+    including contents from ExtUtils::AutoInstall::postamble() --
  619
+    auto installation features disabled.  Please contact the author.
  620
+.
  621
+
  622
+    return 1;
  623
+}
  624
+
  625
+sub postamble {
  626
+    $PostambleUsed = 1;
  627
+
  628
+    return << ".";
  629
+
  630
+config :: installdeps
  631
+\t\@\$(NOOP)
  632
+
  633
+checkdeps ::
  634
+\t\$(PERL) $0 --checkdeps
  635
+
  636
+installdeps ::
  637
+\t$PostambleActions
  638
+
  639
+.
  640
+
  641
+}
  642
+
  643
+1;
  644
+
  645
+__END__
  646
+
  647
+#line 977
768  inc/Module/AutoInstall.pm
... ...
@@ -0,0 +1,768 @@
  1
+#line 1
  2
+package Module::AutoInstall;
  3
+
  4
+use strict;
  5
+use Cwd                 ();
  6
+use ExtUtils::MakeMaker ();
  7
+
  8
+use vars qw{$VERSION};
  9
+BEGIN {
  10
+	$VERSION = '1.03';
  11
+}
  12
+
  13
+# special map on pre-defined feature sets
  14
+my %FeatureMap = (
  15
+    ''      => 'Core Features',    # XXX: deprecated
  16
+    '-core' => 'Core Features',
  17
+);
  18
+
  19
+# various lexical flags
  20
+my ( @Missing, @Existing,  %DisabledTests, $UnderCPAN,     $HasCPANPLUS );
  21
+my ( $Config,  $CheckOnly, $SkipInstall,   $AcceptDefault, $TestOnly );
  22
+my ( $PostambleActions, $PostambleUsed );
  23
+
  24
+# See if it's a testing or non-interactive session
  25
+_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); 
  26
+_init();
  27
+
  28
+sub _accept_default {
  29
+    $AcceptDefault = shift;
  30
+}
  31
+
  32
+sub missing_modules {
  33
+    return @Missing;
  34
+}
  35
+
  36
+sub do_install {
  37
+    __PACKAGE__->install(
  38
+        [
  39
+            $Config
  40
+            ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
  41
+            : ()
  42
+        ],
  43
+        @Missing,
  44
+    );
  45
+}
  46
+
  47
+# initialize various flags, and/or perform install
  48
+sub _init {
  49
+    foreach my $arg (
  50
+        @ARGV,
  51
+        split(
  52
+            /[\s\t]+/,
  53
+            $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || ''
  54
+        )
  55
+      )
  56
+    {
  57
+        if ( $arg =~ /^--config=(.*)$/ ) {
  58
+            $Config = [ split( ',', $1 ) ];
  59
+        }
  60
+        elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
  61
+            __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
  62
+            exit 0;
  63
+        }
  64
+        elsif ( $arg =~ /^--default(?:deps)?$/ ) {
  65
+            $AcceptDefault = 1;
  66
+        }
  67
+        elsif ( $arg =~ /^--check(?:deps)?$/ ) {
  68
+            $CheckOnly = 1;
  69
+        }
  70
+        elsif ( $arg =~ /^--skip(?:deps)?$/ ) {
  71
+            $SkipInstall = 1;
  72
+        }
  73
+        elsif ( $arg =~ /^--test(?:only)?$/ ) {
  74
+            $TestOnly = 1;
  75
+        }
  76
+    }
  77
+}
  78
+
  79
+# overrides MakeMaker's prompt() to automatically accept the default choice
  80
+sub _prompt {
  81
+    goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
  82
+
  83
+    my ( $prompt, $default ) = @_;
  84
+    my $y = ( $default =~ /^[Yy]/ );
  85
+
  86
+    print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
  87
+    print "$default\n";
  88
+    return $default;
  89
+}
  90
+
  91
+# the workhorse
  92
+sub import {
  93
+    my $class = shift;
  94
+    my @args  = @_ or return;
  95
+    my $core_all;
  96
+
  97
+    print "*** $class version " . $class->VERSION . "\n";
  98
+    print "*** Checking for Perl dependencies...\n";
  99
+
  100
+    my $cwd = Cwd::cwd();
  101
+
  102
+    $Config = [];
  103
+
  104
+    my $maxlen = length(
  105
+        (
  106
+            sort   { length($b) <=> length($a) }
  107
+              grep { /^[^\-]/ }
  108
+              map  {
  109
+                ref($_)
  110
+                  ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
  111
+                  : ''
  112
+              }
  113
+              map { +{@args}->{$_} }
  114
+              grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
  115
+        )[0]
  116
+    );
  117
+
  118
+    while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
  119
+        my ( @required, @tests, @skiptests );
  120
+        my $default  = 1;
  121
+        my $conflict = 0;
  122
+
  123
+        if ( $feature =~ m/^-(\w+)$/ ) {
  124
+            my $option = lc($1);
  125
+
  126
+            # check for a newer version of myself
  127
+            _update_to( $modules, @_ ) and return if $option eq 'version';
  128
+
  129
+            # sets CPAN configuration options
  130
+            $Config = $modules if $option eq 'config';
  131
+
  132
+            # promote every features to core status
  133
+            $core_all = ( $modules =~ /^all$/i ) and next
  134
+              if $option eq 'core';
  135
+
  136
+            next unless $option eq 'core';
  137
+        }
  138
+
  139
+        print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
  140
+
  141
+        $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
  142
+
  143
+        unshift @$modules, -default => &{ shift(@$modules) }
  144
+          if ( ref( $modules->[0] ) eq 'CODE' );    # XXX: bugward combatability
  145
+
  146
+        while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
  147
+            if ( $mod =~ m/^-(\w+)$/ ) {
  148
+                my $option = lc($1);
  149
+
  150
+                $default   = $arg    if ( $option eq 'default' );
  151
+                $conflict  = $arg    if ( $option eq 'conflict' );
  152
+                @tests     = @{$arg} if ( $option eq 'tests' );
  153
+                @skiptests = @{$arg} if ( $option eq 'skiptests' );
  154
+
  155
+                next;
  156
+            }
  157
+
  158
+            printf( "- %-${maxlen}s ...", $mod );
  159
+
  160
+            if ( $arg and $arg =~ /^\D/ ) {
  161
+                unshift @$modules, $arg;
  162
+                $arg = 0;
  163
+            }
  164
+
  165
+            # XXX: check for conflicts and uninstalls(!) them.
  166
+            if (
  167
+                defined( my $cur = _version_check( _load($mod), $arg ||= 0 ) ) )
  168
+            {
  169
+                print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
  170
+                push @Existing, $mod => $arg;
  171
+                $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  172
+            }
  173
+            else {
  174
+                print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
  175
+                push @required, $mod => $arg;
  176
+            }
  177
+        }
  178
+
  179
+        next unless @required;
  180
+
  181
+        my $mandatory = ( $feature eq '-core' or $core_all );
  182
+
  183
+        if (
  184
+            !$SkipInstall
  185
+            and (
  186
+                $CheckOnly
  187
+                or _prompt(
  188
+                    qq{==> Auto-install the }
  189
+                      . ( @required / 2 )
  190
+                      . ( $mandatory ? ' mandatory' : ' optional' )
  191
+                      . qq{ module(s) from CPAN?},
  192
+                    $default ? 'y' : 'n',
  193
+                ) =~ /^[Yy]/
  194
+            )
  195
+          )
  196
+        {
  197
+            push( @Missing, @required );
  198
+            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  199
+        }
  200
+
  201
+        elsif ( !$SkipInstall
  202
+            and $default
  203
+            and $mandatory
  204
+            and
  205
+            _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
  206
+            =~ /^[Nn]/ )
  207
+        {
  208
+            push( @Missing, @required );
  209
+            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  210
+        }
  211
+
  212
+        else {
  213
+            $DisabledTests{$_} = 1 for map { glob($_) } @tests;
  214
+        }
  215
+    }
  216
+
  217
+    $UnderCPAN = _check_lock();    # check for $UnderCPAN
  218
+
  219
+    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
  220
+        require Config;
  221
+        print
  222
+"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
  223
+
  224
+        # make an educated guess of whether we'll need root permission.
  225
+        print "    (You may need to do that as the 'root' user.)\n"
  226
+          if eval '$>';
  227
+    }
  228
+    print "*** $class configuration finished.\n";
  229
+
  230
+    chdir $cwd;
  231
+
  232
+    # import to main::
  233
+    no strict 'refs';
  234
+    *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
  235
+}
  236
+
  237
+# Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
  238
+# if we are, then we simply let it taking care of our dependencies
  239
+sub _check_lock {
  240
+    return unless @Missing;
  241
+
  242
+    if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
  243
+        print <<'END_MESSAGE';
  244
+
  245
+*** Since we're running under CPANPLUS, I'll just let it take care
  246
+    of the dependency's installation later.
  247
+END_MESSAGE
  248
+        return 1;
  249
+    }
  250
+
  251
+    _load_cpan();
  252
+
  253
+    # Find the CPAN lock-file
  254
+    my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" );
  255
+    return unless -f $lock;
  256
+
  257
+    # Check the lock
  258
+    local *LOCK;
  259
+    return unless open(LOCK, $lock);
  260
+
  261
+    if (
  262
+            ( $^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid() )
  263
+        and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore'
  264
+    ) {
  265
+        print <<'END_MESSAGE';
  266
+
  267
+*** Since we're running under CPAN, I'll just let it take care
  268
+    of the dependency's installation later.
  269
+END_MESSAGE
  270
+        return 1;
  271
+    }
  272
+
  273
+    close LOCK;
  274
+    return;
  275
+}
  276
+
  277
+sub install {
  278
+    my $class = shift;
  279
+
  280
+    my $i;    # used below to strip leading '-' from config keys
  281
+    my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } );
  282
+
  283
+    my ( @modules, @installed );
  284
+    while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
  285
+
  286
+        # grep out those already installed
  287
+        if ( defined( _version_check( _load($pkg), $ver ) ) ) {
  288
+            push @installed, $pkg;
  289
+        }
  290
+        else {
  291
+            push @modules, $pkg, $ver;
  292
+        }
  293
+    }
  294
+
  295
+    return @installed unless @modules;  # nothing to do
  296
+    return @installed if _check_lock(); # defer to the CPAN shell
  297
+
  298
+    print "*** Installing dependencies...\n";
  299
+
  300
+    return unless _connected_to('cpan.org');
  301
+
  302
+    my %args = @config;
  303
+    my %failed;
  304
+    local *FAILED;
  305
+    if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) {
  306
+        while (<FAILED>) { chomp; $failed{$_}++ }
  307
+        close FAILED;
  308
+
  309
+        my @newmod;
  310
+        while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) {
  311
+            push @newmod, ( $k => $v ) unless $failed{$k};
  312
+        }
  313
+        @modules = @newmod;
  314
+    }
  315
+
  316
+    if ( _has_cpanplus() ) {
  317
+        _install_cpanplus( \@modules, \@config );
  318
+    } else {
  319
+        _install_cpan( \@modules, \@config );
  320
+    }
  321
+
  322
+    print "*** $class installation finished.\n";
  323
+
  324
+    # see if we have successfully installed them
  325
+    while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
  326
+        if ( defined( _version_check( _load($pkg), $ver ) ) ) {
  327
+            push @installed, $pkg;