r2259 - in packages/libmodule-install-perl/trunk: . debian
inc/Module inc/Module/Install lib/Module lib/Module/Install
lib/Module/Install/Admin lib/Module/Install/Makefile
lib/inc/Module t
Krzysztof Krzyzaniak
eloy at costa.debian.org
Tue Mar 7 15:37:07 UTC 2006
Author: eloy
Date: 2006-03-07 15:36:06 +0000 (Tue, 07 Mar 2006)
New Revision: 2259
Added:
packages/libmodule-install-perl/trunk/SIGNATURE
packages/libmodule-install-perl/trunk/t/01_compile.t
packages/libmodule-install-perl/trunk/t/02_basic.t
packages/libmodule-install-perl/trunk/t/03_audotinstall.t
packages/libmodule-install-perl/trunk/t/99_pod.t
Removed:
packages/libmodule-install-perl/trunk/t/1-basic.t
packages/libmodule-install-perl/trunk/t/2-pod.t
packages/libmodule-install-perl/trunk/t/3-autoinstall.t
Modified:
packages/libmodule-install-perl/trunk/Changes
packages/libmodule-install-perl/trunk/MANIFEST
packages/libmodule-install-perl/trunk/META.yml
packages/libmodule-install-perl/trunk/Makefile.PL
packages/libmodule-install-perl/trunk/debian/changelog
packages/libmodule-install-perl/trunk/inc/Module/AutoInstall.pm
packages/libmodule-install-perl/trunk/inc/Module/Install.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/AutoInstall.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Base.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Can.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Fetch.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Include.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Makefile.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Metadata.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/Win32.pm
packages/libmodule-install-perl/trunk/inc/Module/Install/WriteAll.pm
packages/libmodule-install-perl/trunk/lib/Module/AutoInstall.pm
packages/libmodule-install-perl/trunk/lib/Module/Install.pm
packages/libmodule-install-perl/trunk/lib/Module/Install.pod
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Bundle.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Find.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Include.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Makefile.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Manifest.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Metadata.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/ScanDeps.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/WriteAll.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/AutoInstall.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Base.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Build.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Bundle.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Can.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Compiler.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Deprecated.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/External.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Fetch.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Include.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Inline.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/MakeMaker.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Name.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Version.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Metadata.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/PAR.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Run.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Scripts.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Share.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/Win32.pm
packages/libmodule-install-perl/trunk/lib/Module/Install/WriteAll.pm
packages/libmodule-install-perl/trunk/lib/inc/Module/Install.pm
Log:
eloy: new upstream version
Modified: packages/libmodule-install-perl/trunk/Changes
===================================================================
--- packages/libmodule-install-perl/trunk/Changes 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/Changes 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,3 +1,30 @@
+[Changes for 0.59 - 2006-03-07]
+
+* Resolved #18020: 0.58 was broken; inc::Module::Install's @ISA
+ and $VERSION needs to be set by Module::Install on its behalf.
+ (TELS)
+
+[Changes for 0.58 - 2006-03-04]
+
+* Made Module::AutoInstall generally aware of AUTOMATED_TESTING
+
+* Added compatibility with 5.9.3 proxy constants
+
+* Resolved #11169: problems on VMS.
+ This doesn't mean there won't be problems on VMS though,
+ as this path is oldish and their may be more problems.
+
+* Added AUTOMATED_TESTING support to prompt() to force the
+ selection of the default (via PERL_MM_USE_DEFAULT) when it
+ is enabled.
+
+* Added infinite loop protection to prompt() just in case automated
+ and/or shortcutted responses to prompts go badly and leave us
+ looping over the same question.
+
+* Fixed #17961 Use of uninitialized value in array dereference at
+ Module/Install/Metadata.pm line 163. (TELS)
+
[Changes for 0.57 - 2006-02-23]
* Fixed a bug where a misnamed hash key was making the extensions
Modified: packages/libmodule-install-perl/trunk/MANIFEST
===================================================================
--- packages/libmodule-install-perl/trunk/MANIFEST 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/MANIFEST 2006-03-07 15:36:06 UTC (rev 2259)
@@ -51,6 +51,8 @@
MANIFEST.SKIP
META.yml
README
-t/1-basic.t
-t/2-pod.t
-t/3-autoinstall.t
+t/01_compile.t
+t/02_basic.t
+t/03_audotinstall.t
+t/99_pod.t
+SIGNATURE Public-key signature (added by MakeMaker)
Modified: packages/libmodule-install-perl/trunk/META.yml
===================================================================
--- packages/libmodule-install-perl/trunk/META.yml 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/META.yml 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,129 +1,131 @@
-
+abstract: Standalone, extensible Perl module installer
+author: Audrey Tang <autrijus at autrijus.org>
+build_requires:
+ File::Spec: 0
+ Test::Harness: 2.03
+ Test::More: 0.42
+distribution_type: module
+generated_by: Module::Install version 0.59
+license: perl
+name: Module-Install
no_index:
directory:
- example
- inc
- t
-generated_by: Module::Install version 0.57
-distribution_type: module
-version: 0.57
-name: Module-Install
-author: Audrey Tang <autrijus at autrijus.org>
-license: perl
provides:
- Module::Install::Fetch:
- version: 0.57
- file: lib/Module/Install/Fetch.pm
+ Module::AutoInstall:
+ file: lib/Module/AutoInstall.pm
+ version: 1.02
+ Module::Install:
+ file: lib/Module/Install.pm
+ version: 0.59
+ Module::Install::Admin:
+ file: lib/Module/Install/Admin.pm
+ version: 0.59
+ Module::Install::Admin::Bundle:
+ file: lib/Module/Install/Admin/Bundle.pm
+ version: 0.59
+ Module::Install::Admin::Find:
+ file: lib/Module/Install/Admin/Find.pm
+ version: 0.59
+ Module::Install::Admin::Include:
+ file: lib/Module/Install/Admin/Include.pm
+ version: 0.59
+ Module::Install::Admin::Makefile:
+ file: lib/Module/Install/Admin/Makefile.pm
+ version: 0.59
+ Module::Install::Admin::Manifest:
+ file: lib/Module/Install/Admin/Manifest.pm
+ version: 0.59
+ Module::Install::Admin::Metadata:
+ file: lib/Module/Install/Admin/Metadata.pm
+ version: 0.59
+ Module::Install::Admin::ScanDeps:
+ file: lib/Module/Install/Admin/ScanDeps.pm
+ version: 0.59
+ Module::Install::Admin::WriteAll:
+ file: lib/Module/Install/Admin/WriteAll.pm
+ version: 0.59
+ Module::Install::AutoInstall:
+ file: lib/Module/Install/AutoInstall.pm
+ version: 0.59
+ Module::Install::Base:
+ file: lib/Module/Install/Base.pm
+ version: 0.59
+ Module::Install::Base::FakeAdmin:
+ file: lib/Module/Install/Base.pm
+ version: 0.59
+ Module::Install::Build:
+ file: lib/Module/Install/Build.pm
+ version: 0.59
+ Module::Install::Bundle:
+ file: lib/Module/Install/Bundle.pm
+ version: 0.59
+ Module::Install::Can:
+ file: lib/Module/Install/Can.pm
+ version: 0.59
+ Module::Install::Compiler:
+ file: lib/Module/Install/Compiler.pm
+ version: 0.59
Module::Install::Deprecated:
- version: 0.57
file: lib/Module/Install/Deprecated.pm
- Module::Install::Bundle:
- version: 0.57
- file: lib/Module/Install/Bundle.pm
- Module::Install::Admin::Bundle:
- version: 0.57
- file: lib/Module/Install/Admin/Bundle.pm
- Module::Install::MakeMaker:
- version: 0.57
- file: lib/Module/Install/MakeMaker.pm
- Module::Install::Inline:
- version: 0.57
- file: lib/Module/Install/Inline.pm
+ version: 0.59
Module::Install::External:
- version: 0.57
file: lib/Module/Install/External.pm
- Module::Install::PAR:
- version: 0.57
- file: lib/Module/Install/PAR.pm
+ version: 0.59
+ Module::Install::Fetch:
+ file: lib/Module/Install/Fetch.pm
+ version: 0.59
Module::Install::Include:
- version: 0.57
file: lib/Module/Install/Include.pm
- Module::Install::Build:
- version: 0.57
- file: lib/Module/Install/Build.pm
- Module::Install::Admin::ScanDeps:
- version: 0.57
- file: lib/Module/Install/Admin/ScanDeps.pm
- Module::Install::Admin::Manifest:
- version: 0.57
- file: lib/Module/Install/Admin/Manifest.pm
- Module::Install::Admin:
- version: 0.57
- file: lib/Module/Install/Admin.pm
- Module::Install::Base::FakeAdmin:
- version: 0.57
- file: lib/Module/Install/Base.pm
- Module::Install::Metadata:
- version: 0.57
- file: lib/Module/Install/Metadata.pm
+ version: 0.59
+ Module::Install::Inline:
+ file: lib/Module/Install/Inline.pm
+ version: 0.59
+ Module::Install::MakeMaker:
+ file: lib/Module/Install/MakeMaker.pm
+ version: 0.59
Module::Install::Makefile:
- version: 0.57
file: lib/Module/Install/Makefile.pm
- inc::Module::Install:
- file: lib/inc/Module/Install.pm
- Module::Install::Admin::WriteAll:
- version: 0.57
- file: lib/Module/Install/Admin/WriteAll.pm
- Module::Install::Base:
- version: 0.57
- file: lib/Module/Install/Base.pm
- Module::Install::Admin::Find:
- version: 0.57
- file: lib/Module/Install/Admin/Find.pm
+ version: 0.59
+ Module::Install::Makefile::Name:
+ file: lib/Module/Install/Makefile/Name.pm
+ version: 0.59
Module::Install::Makefile::Version:
- version: 0.57
file: lib/Module/Install/Makefile/Version.pm
- Module::Install:
- version: 0.57
- file: lib/Module/Install.pm
- Module::Install::Win32:
- version: 0.57
- file: lib/Module/Install/Win32.pm
- Module::Install::Admin::Makefile:
- version: 0.57
- file: lib/Module/Install/Admin/Makefile.pm
- Module::Install::Admin::Metadata:
- version: 0.57
- file: lib/Module/Install/Admin/Metadata.pm
- Module::Install::Makefile::Name:
- version: 0.57
- file: lib/Module/Install/Makefile/Name.pm
- Module::AutoInstall:
- version: 1.01
- file: lib/Module/AutoInstall.pm
- Module::Install::Can:
- version: 0.57
- file: lib/Module/Install/Can.pm
- Module::Install::AutoInstall:
- version: 0.57
- file: lib/Module/Install/AutoInstall.pm
+ version: 0.59
+ Module::Install::Metadata:
+ file: lib/Module/Install/Metadata.pm
+ version: 0.59
+ Module::Install::PAR:
+ file: lib/Module/Install/PAR.pm
+ version: 0.59
Module::Install::Run:
- version: 0.57
file: lib/Module/Install/Run.pm
- Module::Install::Admin::Include:
- version: 0.57
- file: lib/Module/Install/Admin/Include.pm
+ version: 0.59
Module::Install::Scripts:
- version: 0.57
file: lib/Module/Install/Scripts.pm
+ version: 0.59
+ Module::Install::Share:
+ file: lib/Module/Install/Share.pm
+ version: 0.59
+ Module::Install::Win32:
+ file: lib/Module/Install/Win32.pm
+ version: 0.59
Module::Install::WriteAll:
- version: 0.57
file: lib/Module/Install/WriteAll.pm
- Module::Install::Compiler:
- version: 0.57
- file: lib/Module/Install/Compiler.pm
- Module::Install::Share:
- version: 0.57
- file: lib/Module/Install/Share.pm
-requires:
- perl: 5.004
- YAML: 0.35
-abstract: Standalone, extensible Perl module installer
+ version: 0.59
+ inc::Module::Install:
+ file: lib/inc/Module/Install.pm
+ version: 0.59
recommends:
- PAR::Dist: 0.03
- Test::More: 0
- Test::Harness: 2.03
- Module::ScanDeps: 0.28
+ CPANPLUS: 0.04
Module::Build: 0
Module::CoreList: 0
- CPANPLUS: 0.04
+ Module::ScanDeps: 0.28
+ PAR::Dist: 0.03
+requires:
+ YAML: 0.35
+ perl: 5.004
+version: 0.59
Modified: packages/libmodule-install-perl/trunk/Makefile.PL
===================================================================
--- packages/libmodule-install-perl/trunk/Makefile.PL 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/Makefile.PL 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,27 +1,39 @@
#!perl -w
use strict;
-use lib 'lib'; # NOTE: Module::Install's Makefile.PL needs this statement
- # to bootstrap itself. Other module distributions using
- # Module::Install do not need it.
+# NOTE: Module::Install's Makefile.PL needs this statement to bootstrap
+# itself. Other module distributions using Module::Install do not need it.
+# It causes inc::Module::Install to load from the (unique to this
+# distribution) file ./lib/inc/Module/Install.pm instead of the system
+# inc::Module::Install or the bundled inc/Module::Install.
+use lib 'lib';
use inc::Module::Install;
name 'Module-Install';
author 'Audrey Tang <autrijus at autrijus.org>';
all_from 'lib/Module/Install.pm';
-# If we have YAML::Syck here, don't bother installing YAML.
+# Should be a "requires", but we should solve the
+# "auto-include File::Spec if version < 5.005" problem first.
+build_requires 'File::Spec' => 0;
+
+# We are going to move to Test::More shortly
+build_requires 'Test::Harness' => '2.03';
+build_requires 'Test::More' => '0.42';
+
+# Make sure we have at least one YAML parser
if ( can_cc() ) {
- requires('YAML::Syck' => 0.27) unless can_use('YAML' => 0.35);
+ requires('YAML::Syck' => '0.27') unless can_use('YAML' => 0.35);
} else {
- requires('YAML' => 0.35) unless can_use('YAML::Syck' => 0.27);
+ requires('YAML' => '0.35') unless can_use('YAML::Syck' => 0.27);
}
+### TEMPORARY - Still list it as a mandatory dependency for now
+requires 'YAML' => 0.35;
+
feature 'Include packages with full dependencies',
recommends
- 'Test::Harness' => 2.03, # merely a dependency of M::CoreList
- 'Test::More' => 0, # ditto
'Module::ScanDeps' => 0.28,
'Module::CoreList';
@@ -48,8 +60,7 @@
auto_provides;
-# Still list it as a mandatory dependency for now
-requires 'YAML' => 0.35;
+# Disabled until someone who can sign is doing the releasing
+sign;
-# sign;
WriteAll;
Copied: packages/libmodule-install-perl/trunk/SIGNATURE (from rev 2258, packages/libmodule-install-perl/branches/upstream/current/SIGNATURE)
Modified: packages/libmodule-install-perl/trunk/debian/changelog
===================================================================
--- packages/libmodule-install-perl/trunk/debian/changelog 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/debian/changelog 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,3 +1,9 @@
+libmodule-install-perl (0.59-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org> Tue, 7 Mar 2006 16:34:36 +0100
+
libmodule-install-perl (0.57-1) unstable; urgency=low
* New upstream release
Modified: packages/libmodule-install-perl/trunk/inc/Module/AutoInstall.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/AutoInstall.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/AutoInstall.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,12 +1,14 @@
#line 1 "inc/Module/AutoInstall.pm - lib/Module/AutoInstall.pm"
package Module::AutoInstall;
-$Module::AutoInstall::VERSION = '1.01';
use strict;
use Cwd ();
use ExtUtils::MakeMaker ();
-#line 218
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '1.02';
+}
# special map on pre-defined feature sets
my %FeatureMap = (
@@ -19,7 +21,8 @@
my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly );
my ( $PostambleActions, $PostambleUsed );
-_accept_default( !-t STDIN ); # see if it's a non-interactive session
+# See if it's a testing or non-interactive session
+_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
_init();
sub _accept_default {
@@ -92,7 +95,7 @@
my $core_all;
print "*** $class version " . $class->VERSION . "\n";
- print "*** Checking for dependencies...\n";
+ print "*** Checking for Perl dependencies...\n";
my $cwd = Cwd::cwd();
@@ -690,7 +693,7 @@
$PostambleActions = (
$missing
? "\$(PERL) $0 --config=$config --installdeps=$missing"
- : "\@\$(NOOP)"
+ : "\$(NOECHO) \$(NOOP)"
);
return %args;
@@ -731,7 +734,7 @@
return << ".";
config :: installdeps
-\t\@\$(NOOP)
+\t\$(NOECHO) \$(NOOP)
checkdeps ::
\t\$(PERL) $0 --checkdeps
@@ -747,4 +750,4 @@
__END__
-#line 979
+#line 988
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/AutoInstall.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/AutoInstall.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/AutoInstall.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw{Module::Install::Base};
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Base.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Base.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Base.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,7 +1,7 @@
#line 1 "inc/Module/Install/Base.pm - lib/Module/Install/Base.pm"
package Module::Install::Base;
-$VERSION = '0.57';
+$VERSION = '0.59';
# Suspend handler for "redefined" warnings
BEGIN {
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Can.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Can.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Can.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use Config ();
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Fetch.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Fetch.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Fetch.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,10 +1,14 @@
#line 1 "inc/Module/Install/Fetch.pm - lib/Module/Install/Fetch.pm"
package Module::Install::Fetch;
+use strict;
use Module::Install::Base;
- at ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+use vars qw{$VERSION @ISA};
+BEGIN {
+ $VERSION = '0.59';
+ @ISA = qw{Module::Install::Base};
+}
sub get_file {
my ($self, %args) = @_;
@@ -55,14 +59,14 @@
chdir $dir; return;
}
- my @dialog = split(/\n/, << ".");
+ my @dialog = split(/\n/, <<"END_FTP");
open $host
user anonymous anonymous\@example.com
cd $path
binary
get $file $file
quit
-.
+END_FTP
foreach (@dialog) { $fh->print("$_\n") }
$fh->close;
} }
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Include.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Include.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Include.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Makefile.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Makefile.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Makefile.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -7,15 +7,30 @@
use vars qw{$VERSION @ISA};
BEGIN {
- $VERSION = '0.57';
+ $VERSION = '0.59';
@ISA = qw{Module::Install::Base};
}
sub Makefile { $_[0] }
+my %seen = ();
+
sub prompt {
shift;
- goto &ExtUtils::MakeMaker::prompt;
+
+ # Infinite loop protection
+ my @c = caller();
+ if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+ die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+ }
+
+ # In automated testing, always use defaults
+ if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ goto &ExtUtils::MakeMaker::prompt;
+ } else {
+ goto &ExtUtils::MakeMaker::prompt;
+ }
}
sub makemaker_args {
@@ -69,25 +84,26 @@
die "&Makefile->write() takes no arguments\n" if @_;
my $args = $self->makemaker_args;
-
$args->{DISTNAME} = $self->name;
- $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
- $args->{VERSION} = $self->version || $self->determine_VERSION($args);
- $args->{NAME} =~ s/-/::/g;
-
- $args->{test} = {TESTS => $self->tests} if $self->tests;
-
+ $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+ $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+ $args->{NAME} =~ s/-/::/g;
+ if ( $self->tests ) {
+ $args->{test} = { TESTS => $self->tests };
+ }
if ($] >= 5.005) {
$args->{ABSTRACT} = $self->abstract;
- $args->{AUTHOR} = $self->author;
+ $args->{AUTHOR} = $self->author;
}
if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
$args->{NO_META} = 1;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
- $args->{SIGN} = 1 if $self->sign;
+ if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+ $args->{SIGN} = 1;
}
- delete $args->{SIGN} unless $self->is_admin;
+ unless ( $self->is_admin ) {
+ delete $args->{SIGN};
+ }
# merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
@@ -104,50 +120,49 @@
}
}
- if (my $perl_version = $self->perl_version) {
+ if ( my $perl_version = $self->perl_version ) {
eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, ".
- "but we need version >= $perl_version";
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
}
- my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
-
+ my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
if ($self->admin->preop) {
$args{dist} = $self->admin->preop;
}
- ExtUtils::MakeMaker::WriteMakefile(%args);
-
- $self->fix_up_makefile();
+ my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+ $self->fix_up_makefile($mm->{FIRST_MAKEFILE});
}
sub fix_up_makefile {
- my $self = shift;
- my $top_class = ref($self->_top) || '';
- my $top_version = $self->_top->VERSION || '';
+ my $self = shift;
+ my $makefile_name = shift;
+ my $top_class = ref($self->_top) || '';
+ my $top_version = $self->_top->VERSION || '';
my $preamble = $self->preamble
- ? "# Preamble by $top_class $top_version\n" . $self->preamble
- : '';
- my $postamble = "# Postamble by $top_class $top_version\n" .
- ($self->postamble || '');
+ ? "# Preamble by $top_class $top_version\n"
+ . $self->preamble
+ : '';
+ my $postamble = "# Postamble by $top_class $top_version\n"
+ . ($self->postamble || '');
local *MAKEFILE;
- open MAKEFILE, '< Makefile' or die $!;
+ open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
my $makefile = do { local $/; <MAKEFILE> };
close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+ $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+ $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
- $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
- $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+ open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ print MAKEFILE "$preamble$makefile$postamble" or die $!;
+ close MAKEFILE or die $!;
- open MAKEFILE, '> Makefile' or die $!;
- print MAKEFILE "$preamble$makefile$postamble" or die $!;
- close MAKEFILE or die $!;
-
1;
}
@@ -168,4 +183,4 @@
__END__
-#line 295
+#line 312
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Metadata.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Metadata.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Metadata.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw{Module::Install::Base};
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict 'vars';
@@ -161,7 +161,9 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return @{ $self->{values}{features} };
+ return $self->{values}->{features}
+ ? @{ $self->{values}->{features} }
+ : ();
}
sub no_index {
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/Win32.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/Win32.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/Win32.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install/WriteAll.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install/WriteAll.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install/WriteAll.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,7 +4,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/inc/Module/Install.pm
===================================================================
--- packages/libmodule-install-perl/trunk/inc/Module/Install.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/inc/Module/Install.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,4 +1,4 @@
-#line 1 "/home/adam/modinstall/trunk/inc/Module/Install.pm - lib/Module/Install.pm"
+#line 1 "/home/autrijus/work/modinstall/trunk/Module-Install/inc/Module/Install.pm - lib/Module/Install.pm"
package Module::Install;
use 5.004;
@@ -12,11 +12,12 @@
# 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.57';
+ $VERSION = '0.59';
}
# inc::Module::Install must be loaded first
-unless ( $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'} ) {
+my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
+unless ( $INC{$file} ) {
die <<"END_DIE";
Please invoke ${\__PACKAGE__} with:
@@ -35,21 +36,20 @@
use FindBin;
*inc::Module::Install::VERSION = *VERSION;
- at inc::Module::Install::ISA = 'Module::Install';
+ at inc::Module::Install::ISA = __PACKAGE__;
sub autoload {
- my $self = shift;
- my $caller = $self->_caller;
- my $cwd = Cwd::cwd();
- my $sym = "$caller\::AUTOLOAD";
-
+ my $self = shift;
+ my $who = $self->_caller;
+ my $cwd = Cwd::cwd();
+ my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
# delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
- $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller - $sym";
+ $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
unshift @_, ($self, $1);
goto &{$self->can('call')} unless uc($1) eq $1;
};
@@ -58,18 +58,18 @@
sub import {
my $class = shift;
my $self = $class->new(@_);
+ my $who = $self->_caller;
unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
- $self->{admin} =
- "$self->{name}::$self->{dispatch}"->new(_top => $self);
+ $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
- *{$self->_caller . "::AUTOLOAD"} = $self->autoload;
+ *{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
@@ -95,18 +95,18 @@
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
- next unless defined *{$glob}{CODE};
+ next unless exists &{ref($obj).'::'.$method};
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
}
- my $caller = $self->_caller;
+ my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
- *{"${caller}::$name"} = sub {
- ${"${caller}::AUTOLOAD"} = "${caller}::$name";
- goto &{"${caller}::AUTOLOAD"};
+ *{"${who}::$name"} = sub {
+ ${"${who}::AUTOLOAD"} = "${who}::$name";
+ goto &{"${who}::AUTOLOAD"};
};
}
}
@@ -124,30 +124,26 @@
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
- $args{author} ||= '.author';
+ $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
$args{bundle} ||= 'inc/BUNDLES';
$args{base} ||= $base_path;
-
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
-
unless ( $args{path} ) {
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
- bless(\%args, $class);
+ bless \%args, $class;
}
sub call {
- my $self = shift;
- my $method = shift;
- my $obj = $self->load($method) or return;
-
- unshift @_, $obj;
- goto &{$obj->can($method)};
+ my ($self, $method) = @_;
+ my $obj = $self->load($method) or return;
+ splice(@_, 0, 2, $obj);
+ goto &{$obj->can($method)};
}
sub load {
@@ -173,13 +169,14 @@
}
sub load_extensions {
- my ($self, $path, $top_obj) = @_;
+ my ($self, $path, $top) = @_;
- unshift @INC, $self->{prefix}
- unless grep { $_ eq $self->{prefix} } @INC;
+ unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unshift @INC, $self->{prefix};
+ }
local @INC = ($path, @INC);
- foreach my $rv ($self->find_extensions($path)) {
+ foreach my $rv ( $self->find_extensions($path) ) {
my ($file, $pkg) = @{$rv};
next if $self->{pathnames}{$pkg};
@@ -190,7 +187,7 @@
next;
}
$self->{pathnames}{$pkg} = delete $INC{$file};
- push @{$self->{extensions}}, &{$new}($pkg, _top => $top_obj );
+ push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
}
$self->{extensions} ||= [];
@@ -203,10 +200,32 @@
File::Find::find( sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
- return if $1 eq $self->{dispatch};
+ my $subpath = $1;
+ return if lc($subpath) eq lc($self->{dispatch});
- $file = "$self->{path}/$1.pm";
- my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
+ $file = "$self->{path}/$subpath.pm";
+ my $pkg = "$self->{name}::$subpath";
+ $pkg =~ s!/!::!g;
+
+ # If we have a mixed-case package name, assume case has been preserved
+ # correctly. Otherwise, root through the file to locate the case-preserved
+ # version of the package name.
+ if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
+ open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
+ my $in_pod = 0;
+ while ( <PKGFILE> ) {
+ $in_pod = 1 if /^=\w/;
+ $in_pod = 0 if /^=cut/;
+ next if ($in_pod || /^=cut/); # skip pod text
+ next if /^\s*#/; # and comments
+ if ( m/^\s*package\s+($pkg)\s*;/i ) {
+ $pkg = $1;
+ last;
+ }
+ }
+ close PKGFILE;
+ }
+
push @found, [ $file, $pkg ];
}, $path ) if -d $path;
@@ -214,15 +233,13 @@
}
sub _caller {
- my $depth = 0;
- my $caller = caller($depth);
-
- while ($caller eq __PACKAGE__) {
+ my $depth = 0;
+ my $call = caller($depth);
+ while ( $call eq __PACKAGE__ ) {
$depth++;
- $caller = caller($depth);
+ $call = caller($depth);
}
-
- $caller;
+ return $call;
}
1;
Modified: packages/libmodule-install-perl/trunk/lib/Module/AutoInstall.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/AutoInstall.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/AutoInstall.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,222 +1,14 @@
package Module::AutoInstall;
-$Module::AutoInstall::VERSION = '1.01';
use strict;
use Cwd ();
use ExtUtils::MakeMaker ();
-=head1 NAME
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '1.02';
+}
-Module::AutoInstall - Automatic install of dependencies via CPAN
-
-=head1 SYNOPSIS
-
-In F<Makefile.PL>, with L<Module::Install> available on the author's system:
-
- use inc::Module::Install;
-
- name 'Joe-Hacker';
- abstract 'Perl Interface to Joe Hacker';
- author 'Joe Hacker <joe at hacker.org>';
- include 'Module::AutoInstall';
-
- requires 'Module0'; # mandatory modules
-
- feature 'Feature1',
- -default => 0,
- 'Module2' => '0.1';
-
- feature 'Feature2',
- -default => 0,
- 'Module3' => '1.0';
-
- auto_install(
- make_args => '--hello', # option(s) for CPAN::Config
- force => 1, # pseudo-option to force install
- do_once => 1, # skip previously failed modules
- );
-
- WriteAll;
-
-Invoking the resulting F<Makefile.PL>:
-
- % perl Makefile.PL # interactive behaviour
- % perl Makefile.PL --defaultdeps # accept default value on prompts
- % perl Makefile.PL --checkdeps # check only, no Makefile produced
- % perl Makefile.PL --skipdeps # ignores all dependencies
- % perl Makefile.PL --testonly # don't write installation targets
-
-Note that the trailing 'deps' of arguments may be omitted, too.
-
-Using C<--defaultdeps> will make F<Makefile.PL> behave similarly to a regular
-Makefile.PL file with C<PREREQ_PM> dependencies.
-
-One can use environment variables (see "ENVIRONMENT") below to set a default
-behavior instead of specifying it in the command line for every invocation
-of F<Makefile.PL>.
-
-Using F<make> (or F<nmake>):
-
- % make [all|test|install] # install dependencies first
- % make checkdeps # same as the --checkdeps above
- % make installdeps # install dependencies only
-
-=head1 DESCRIPTION
-
-B<Module::AutoInstall> lets module writers to specify a more
-sophisticated form of dependency information than the C<PREREQ_PM>
-option offered by B<ExtUtils::MakeMaker>.
-
-This module works best with the B<Module::Install> framework,
-a drop-in replacement for MakeMaker. However, this module also
-supports F<Makefile.PL> files based on MakeMaker; see L</EXAMPLES>
-for instructions.
-
-=head2 Prerequisites and Features
-
-Prerequisites are grouped into B<features>, and the user could choose
-yes/no on each one's dependencies; the module writer may also supply a
-boolean value via C<-default> to specify the default choice.
-
-The B<Core Features> marked by the name C<-core> will double-check with
-the user, if the user chooses not to install the mandatory modules.
-This differs from the pre-0.26 'silent install' behaviour.
-
-Starting from version 0.27, if C<-core> is set to the string C<all>
-(case-insensitive), every feature will be considered mandatory.
-
-The dependencies are expressed as pairs of C<Module> => C<version>
-inside an array reference. If the order does not matter, and there
-are no C<-default>, C<-tests> or C<-skiptests> directives for that
-feature, you may also use a hash reference.
-
-=head2 The Installation Process
-
-Once B<Module::AutoInstall> has determined which module(s) are needed,
-it checks whether it's running under the B<CPAN> shell and should
-therefore let B<CPAN> handle the dependency.
-
-Finally, the C<WriteMakefile()> is overridden to perform some additional
-checks, as well as skips tests associated with disabled features by the
-C<-tests> option.
-
-The actual installation happens at the end of the C<make config> target;
-both C<make test> and C<make install> will trigger the installation of
-required modules.
-
-If it's not running under B<CPAN>, the installer will probe for an
-active connection by trying to resolve the domain C<cpan.org>, and check
-for the user's permission to use B<CPAN>. If all went well, a separate
- B<CPAN> instance is created to install the required modules.
-
-If you have the B<CPANPLUS> package installed in your system, it is
-preferred by default over B<CPAN>; it also accepts some extra options
-(e.g. C<-target =E<gt> 'skiptest', -skiptest =E<gt> 1> to skip testing).
-
-All modules scheduled to be installed will be deleted from C<%INC>
-first, so B<ExtUtils::MakeMaker> will check the newly installed modules.
-
-Additionally, you could use the C<make installdeps> target to install
-the modules, and the C<make checkdeps> target to check dependencies
-without actually installing them; the C<perl Makefile.PL --checkdeps>
-command has an equivalent effect.
-
-If the F<Makefile.PL> itself needs to use an independent module (e.g.
-B<Acme::KillarApp>, v1.21 or greater), then use something like below:
-
- BEGIN {
- require Module::AutoInstall;
- # the first argument is an arrayref of the -config flags
- Module::AutoInstall->install([], 'Acme::KillerApp' => 1.21);
- }
- use Acme::KillerApp 1.21;
-
- Module::AutoInstall->import(
- # ... arguments as usual ...
- );
-
-Note the version test in the use clause; if you are so close to the
-cutting edge that B<Acme::KillerApp> 1.20 is the latest version on CPAN,
-this will prevent your module from going awry.
-
-=head2 User-Defined Hooks
-
-User-defined I<pre-installation> and I<post-installation> hooks are
-available via C<MY::preinstall> and C<MY::postinstall> subroutines,
-as shown below:
-
- # pre-install handler; takes $module_name and $version
- sub MY::preinstall { return 1; } # return false to skip install
-
- # post-install handler; takes $module_name, $version, $success
- sub MY::postinstall { return; } # the return value doesn't matter
-
-Note that since B<Module::AutoInstall> performs installation at the
-time of C<use> (i.e. before perl parses the remainder of
-F<Makefile.PL>), you have to declare those two handlers I<before> the
-C<use> statement for them to take effect.
-
-If the user did not choose to install a module or it already exists on
-the system, neither of the handlers is invoked. Both handlers are invoked
-exactly once for each module when installation is attempted.
-
-C<MY::preinstall> takes two arguments, C<$module_name> and C<$version>;
-if it returns a false value, installation for that module will be
-skipped, and C<MY::postinstall> won't be called at all.
-
-C<MY::postinstall> takes three arguments, C<$module_name>, C<$version>
-and C<$success>. The last one denotes whether the installation
-succeeded or not: C<1> means installation completed successfully, C<0>
-means failure during install, and C<undef> means that the installation
-was not attempted at all, possibly due to connection problems, or that
-module does not exist on CPAN at all.
-
-=head2 Customized C<MY::postamble>
-
-Starting from version 0.43, B<Module::AutoInstall> supports modules
-that require a C<MY::postamble> subroutine in their F<Makefile.PL>.
-The user-defined C<MY::postamble>, if present, is responsible for
-calling C<Module::AutoInstall::postamble> and include the output in
-its return value.
-
-For example, the B<DBD::*> (database driver) modules for the Perl DBI
-are required to include the postamble generated by the function
-C<dbd_postamble>, so their F<Makefile.PL> may contain lines like this:
-
- sub MY::postamble {
- return &Module::AutoInstall::postamble . &dbd_postamble;
- }
-
-Note that the B<Module::AutoInstall> module does not export the
-C<postamble> function, so the name should always be fully qualified.
-
-=head1 CAVEATS
-
-B<Module::AutoInstall> will add C<UNINST=1> to your B<make install>
-flags if your effective uid is 0 (root), unless you explicitly disable
-it by setting B<CPAN>'s C<make_install_arg> configuration option (or the
-C<makeflags> option of B<CPANPLUS>) to include C<UNINST=0>. This I<may>
-cause dependency problems if you are using a fine-tuned directory
-structure for your site. Please consult L<CPAN/FAQ> for an explanation
-in detail.
-
-If either B<version> or B<Sort::Versions> is available, they will be
-used to compare the required version with the existing module's version
-and the CPAN module's. Otherwise it silently falls back to use I<cmp>.
-This may cause inconsistent behaviours in pathetic situations.
-
-=head1 ENVIRONMENT
-
-B<Module::AutoInstall> uses a single environment variable,
-C<PERL_AUTOINSTALL>. It is taken as the command line argument
-passed to F<Makefile.PL>; you could set it to either C<--defaultdeps> or
-C<--skipdeps> to avoid interactive behaviour.
-
-It also read from the C<PERL_EXTUTILS_AUTOINSTALL> environment variable if
-C<PERL_AUTOINSTALL> is not defined.
-
-=cut
-
# special map on pre-defined feature sets
my %FeatureMap = (
'' => 'Core Features', # XXX: deprecated
@@ -228,7 +20,8 @@
my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly );
my ( $PostambleActions, $PostambleUsed );
-_accept_default( !-t STDIN ); # see if it's a non-interactive session
+# See if it's a testing or non-interactive session
+_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
_init();
sub _accept_default {
@@ -301,7 +94,7 @@
my $core_all;
print "*** $class version " . $class->VERSION . "\n";
- print "*** Checking for dependencies...\n";
+ print "*** Checking for Perl dependencies...\n";
my $cwd = Cwd::cwd();
@@ -899,7 +692,7 @@
$PostambleActions = (
$missing
? "\$(PERL) $0 --config=$config --installdeps=$missing"
- : "\@\$(NOOP)"
+ : "\$(NOECHO) \$(NOOP)"
);
return %args;
@@ -940,7 +733,7 @@
return << ".";
config :: installdeps
-\t\@\$(NOOP)
+\t\$(NOECHO) \$(NOOP)
checkdeps ::
\t\$(PERL) $0 --checkdeps
@@ -956,6 +749,218 @@
__END__
+=pod
+
+=head1 NAME
+
+Module::AutoInstall - Automatic install of dependencies via CPAN
+
+=head1 SYNOPSIS
+
+In F<Makefile.PL>, with L<Module::Install> available on the author's system:
+
+ use inc::Module::Install;
+
+ name 'Joe-Hacker';
+ abstract 'Perl Interface to Joe Hacker';
+ author 'Joe Hacker <joe at hacker.org>';
+ include 'Module::AutoInstall';
+
+ requires 'Module0'; # mandatory modules
+
+ feature 'Feature1',
+ -default => 0,
+ 'Module2' => '0.1';
+
+ feature 'Feature2',
+ -default => 0,
+ 'Module3' => '1.0';
+
+ auto_install(
+ make_args => '--hello', # option(s) for CPAN::Config
+ force => 1, # pseudo-option to force install
+ do_once => 1, # skip previously failed modules
+ );
+
+ WriteAll;
+
+Invoking the resulting F<Makefile.PL>:
+
+ % perl Makefile.PL # interactive behaviour
+ % perl Makefile.PL --defaultdeps # accept default value on prompts
+ % perl Makefile.PL --checkdeps # check only, no Makefile produced
+ % perl Makefile.PL --skipdeps # ignores all dependencies
+ % perl Makefile.PL --testonly # don't write installation targets
+
+Note that the trailing 'deps' of arguments may be omitted, too.
+
+Using C<--defaultdeps> will make F<Makefile.PL> behave similarly to a regular
+Makefile.PL file with C<PREREQ_PM> dependencies.
+
+One can use environment variables (see "ENVIRONMENT") below to set a default
+behavior instead of specifying it in the command line for every invocation
+of F<Makefile.PL>.
+
+Using F<make> (or F<nmake>):
+
+ % make [all|test|install] # install dependencies first
+ % make checkdeps # same as the --checkdeps above
+ % make installdeps # install dependencies only
+
+=head1 DESCRIPTION
+
+B<Module::AutoInstall> lets module writers to specify a more
+sophisticated form of dependency information than the C<PREREQ_PM>
+option offered by B<ExtUtils::MakeMaker>.
+
+This module works best with the B<Module::Install> framework,
+a drop-in replacement for MakeMaker. However, this module also
+supports F<Makefile.PL> files based on MakeMaker; see L</EXAMPLES>
+for instructions.
+
+=head2 Prerequisites and Features
+
+Prerequisites are grouped into B<features>, and the user could choose
+yes/no on each one's dependencies; the module writer may also supply a
+boolean value via C<-default> to specify the default choice.
+
+The B<Core Features> marked by the name C<-core> will double-check with
+the user, if the user chooses not to install the mandatory modules.
+This differs from the pre-0.26 'silent install' behaviour.
+
+Starting from version 0.27, if C<-core> is set to the string C<all>
+(case-insensitive), every feature will be considered mandatory.
+
+The dependencies are expressed as pairs of C<Module> => C<version>
+inside an array reference. If the order does not matter, and there
+are no C<-default>, C<-tests> or C<-skiptests> directives for that
+feature, you may also use a hash reference.
+
+=head2 The Installation Process
+
+Once B<Module::AutoInstall> has determined which module(s) are needed,
+it checks whether it's running under the B<CPAN> shell and should
+therefore let B<CPAN> handle the dependency.
+
+Finally, the C<WriteMakefile()> is overridden to perform some additional
+checks, as well as skips tests associated with disabled features by the
+C<-tests> option.
+
+The actual installation happens at the end of the C<make config> target;
+both C<make test> and C<make install> will trigger the installation of
+required modules.
+
+If it's not running under B<CPAN>, the installer will probe for an
+active connection by trying to resolve the domain C<cpan.org>, and check
+for the user's permission to use B<CPAN>. If all went well, a separate
+ B<CPAN> instance is created to install the required modules.
+
+If you have the B<CPANPLUS> package installed in your system, it is
+preferred by default over B<CPAN>; it also accepts some extra options
+(e.g. C<-target =E<gt> 'skiptest', -skiptest =E<gt> 1> to skip testing).
+
+All modules scheduled to be installed will be deleted from C<%INC>
+first, so B<ExtUtils::MakeMaker> will check the newly installed modules.
+
+Additionally, you could use the C<make installdeps> target to install
+the modules, and the C<make checkdeps> target to check dependencies
+without actually installing them; the C<perl Makefile.PL --checkdeps>
+command has an equivalent effect.
+
+If the F<Makefile.PL> itself needs to use an independent module (e.g.
+B<Acme::KillarApp>, v1.21 or greater), then use something like below:
+
+ BEGIN {
+ require Module::AutoInstall;
+ # the first argument is an arrayref of the -config flags
+ Module::AutoInstall->install([], 'Acme::KillerApp' => 1.21);
+ }
+ use Acme::KillerApp 1.21;
+
+ Module::AutoInstall->import(
+ # ... arguments as usual ...
+ );
+
+Note the version test in the use clause; if you are so close to the
+cutting edge that B<Acme::KillerApp> 1.20 is the latest version on CPAN,
+this will prevent your module from going awry.
+
+=head2 User-Defined Hooks
+
+User-defined I<pre-installation> and I<post-installation> hooks are
+available via C<MY::preinstall> and C<MY::postinstall> subroutines,
+as shown below:
+
+ # pre-install handler; takes $module_name and $version
+ sub MY::preinstall { return 1; } # return false to skip install
+
+ # post-install handler; takes $module_name, $version, $success
+ sub MY::postinstall { return; } # the return value doesn't matter
+
+Note that since B<Module::AutoInstall> performs installation at the
+time of C<use> (i.e. before perl parses the remainder of
+F<Makefile.PL>), you have to declare those two handlers I<before> the
+C<use> statement for them to take effect.
+
+If the user did not choose to install a module or it already exists on
+the system, neither of the handlers is invoked. Both handlers are invoked
+exactly once for each module when installation is attempted.
+
+C<MY::preinstall> takes two arguments, C<$module_name> and C<$version>;
+if it returns a false value, installation for that module will be
+skipped, and C<MY::postinstall> won't be called at all.
+
+C<MY::postinstall> takes three arguments, C<$module_name>, C<$version>
+and C<$success>. The last one denotes whether the installation
+succeeded or not: C<1> means installation completed successfully, C<0>
+means failure during install, and C<undef> means that the installation
+was not attempted at all, possibly due to connection problems, or that
+module does not exist on CPAN at all.
+
+=head2 Customized C<MY::postamble>
+
+Starting from version 0.43, B<Module::AutoInstall> supports modules
+that require a C<MY::postamble> subroutine in their F<Makefile.PL>.
+The user-defined C<MY::postamble>, if present, is responsible for
+calling C<Module::AutoInstall::postamble> and include the output in
+its return value.
+
+For example, the B<DBD::*> (database driver) modules for the Perl DBI
+are required to include the postamble generated by the function
+C<dbd_postamble>, so their F<Makefile.PL> may contain lines like this:
+
+ sub MY::postamble {
+ return &Module::AutoInstall::postamble . &dbd_postamble;
+ }
+
+Note that the B<Module::AutoInstall> module does not export the
+C<postamble> function, so the name should always be fully qualified.
+
+=head1 CAVEATS
+
+B<Module::AutoInstall> will add C<UNINST=1> to your B<make install>
+flags if your effective uid is 0 (root), unless you explicitly disable
+it by setting B<CPAN>'s C<make_install_arg> configuration option (or the
+C<makeflags> option of B<CPANPLUS>) to include C<UNINST=0>. This I<may>
+cause dependency problems if you are using a fine-tuned directory
+structure for your site. Please consult L<CPAN/FAQ> for an explanation
+in detail.
+
+If either B<version> or B<Sort::Versions> is available, they will be
+used to compare the required version with the existing module's version
+and the CPAN module's. Otherwise it silently falls back to use I<cmp>.
+This may cause inconsistent behaviours in pathetic situations.
+
+=head1 ENVIRONMENT
+
+B<Module::AutoInstall> uses a single environment variable,
+C<PERL_AUTOINSTALL>. It is taken as the command line argument
+passed to F<Makefile.PL>; you could set it to either C<--defaultdeps> or
+C<--skipdeps> to avoid interactive behaviour.
+
+It also read from the C<PERL_EXTUTILS_AUTOINSTALL> environment variable if
+C<PERL_AUTOINSTALL> is not defined.
+
=head1 SEE ALSO
L<Module::Install>
@@ -967,10 +972,14 @@
Audrey Tang E<lt>autrijus at autrijus.orgE<gt>
+Adam Kennedy E<lt>cpan at ali.asE<gt>
+
=head1 COPYRIGHT
-Copyright 2001, 2002, 2003, 2004, 2005, 2006 by Audrey Tang.
+Copyright 2001, 2002, 2003, 2004, 2005, 2006 by Audrey Tang
+Some parts copyright 2006 Adam Kennedy
+
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Bundle.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Bundle.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Bundle.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Find.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Find.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Find.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use File::Find ();
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Include.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Include.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Include.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
sub include {
my ( $self, $pattern ) = @_;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Makefile.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Makefile.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Makefile.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict 'vars';
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Manifest.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Manifest.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Manifest.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use Cwd;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Metadata.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Metadata.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/Metadata.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = 'Module::Install::Base';
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/ScanDeps.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/ScanDeps.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/ScanDeps.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/WriteAll.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/WriteAll.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin/WriteAll.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
sub WriteAll {
my ($self, %args) = @_;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Admin.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Admin.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Admin.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,6 +1,6 @@
package Module::Install::Admin;
-$VERSION = '0.57';
+$VERSION = '0.59';
@ISA = 'Module::Install';
use strict 'vars';
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/AutoInstall.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/AutoInstall.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/AutoInstall.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw{Module::Install::Base};
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Base.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Base.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Base.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,6 +1,6 @@
package Module::Install::Base;
-$VERSION = '0.57';
+$VERSION = '0.59';
# Suspend handler for "redefined" warnings
BEGIN {
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Build.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Build.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Build.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Bundle.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Bundle.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Bundle.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use Cwd ();
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Can.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Can.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Can.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use Config ();
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Compiler.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Compiler.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Compiler.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA};
BEGIN {
- $VERSION = '0.57';
+ $VERSION = '0.59';
@ISA = qw{Module::Install::Base};
}
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Deprecated.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Deprecated.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Deprecated.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA};
BEGIN {
- $VERSION = '0.57';
+ $VERSION = '0.59';
@ISA = qw{Module::Install::Base};
}
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/External.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/External.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/External.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -5,7 +5,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Fetch.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Fetch.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Fetch.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,9 +1,13 @@
package Module::Install::Fetch;
+use strict;
use Module::Install::Base;
- at ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+use vars qw{$VERSION @ISA};
+BEGIN {
+ $VERSION = '0.59';
+ @ISA = qw{Module::Install::Base};
+}
sub get_file {
my ($self, %args) = @_;
@@ -54,14 +58,14 @@
chdir $dir; return;
}
- my @dialog = split(/\n/, << ".");
+ my @dialog = split(/\n/, <<"END_FTP");
open $host
user anonymous anonymous\@example.com
cd $path
binary
get $file $file
quit
-.
+END_FTP
foreach (@dialog) { $fh->print("$_\n") }
$fh->close;
} }
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Include.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Include.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Include.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Inline.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Inline.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Inline.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/MakeMaker.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/MakeMaker.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/MakeMaker.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use ExtUtils::MakeMaker ();
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Name.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Name.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Name.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Version.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Version.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile/Version.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Makefile.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -6,15 +6,30 @@
use vars qw{$VERSION @ISA};
BEGIN {
- $VERSION = '0.57';
+ $VERSION = '0.59';
@ISA = qw{Module::Install::Base};
}
sub Makefile { $_[0] }
+my %seen = ();
+
sub prompt {
shift;
- goto &ExtUtils::MakeMaker::prompt;
+
+ # Infinite loop protection
+ my @c = caller();
+ if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+ die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+ }
+
+ # In automated testing, always use defaults
+ if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ goto &ExtUtils::MakeMaker::prompt;
+ } else {
+ goto &ExtUtils::MakeMaker::prompt;
+ }
}
sub makemaker_args {
@@ -68,25 +83,26 @@
die "&Makefile->write() takes no arguments\n" if @_;
my $args = $self->makemaker_args;
-
$args->{DISTNAME} = $self->name;
- $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
- $args->{VERSION} = $self->version || $self->determine_VERSION($args);
- $args->{NAME} =~ s/-/::/g;
-
- $args->{test} = {TESTS => $self->tests} if $self->tests;
-
+ $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+ $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+ $args->{NAME} =~ s/-/::/g;
+ if ( $self->tests ) {
+ $args->{test} = { TESTS => $self->tests };
+ }
if ($] >= 5.005) {
$args->{ABSTRACT} = $self->abstract;
- $args->{AUTHOR} = $self->author;
+ $args->{AUTHOR} = $self->author;
}
if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
$args->{NO_META} = 1;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
- $args->{SIGN} = 1 if $self->sign;
+ if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+ $args->{SIGN} = 1;
}
- delete $args->{SIGN} unless $self->is_admin;
+ unless ( $self->is_admin ) {
+ delete $args->{SIGN};
+ }
# merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
@@ -103,50 +119,49 @@
}
}
- if (my $perl_version = $self->perl_version) {
+ if ( my $perl_version = $self->perl_version ) {
eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, ".
- "but we need version >= $perl_version";
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
}
- my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
-
+ my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
if ($self->admin->preop) {
$args{dist} = $self->admin->preop;
}
- ExtUtils::MakeMaker::WriteMakefile(%args);
-
- $self->fix_up_makefile();
+ my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+ $self->fix_up_makefile($mm->{FIRST_MAKEFILE});
}
sub fix_up_makefile {
- my $self = shift;
- my $top_class = ref($self->_top) || '';
- my $top_version = $self->_top->VERSION || '';
+ my $self = shift;
+ my $makefile_name = shift;
+ my $top_class = ref($self->_top) || '';
+ my $top_version = $self->_top->VERSION || '';
my $preamble = $self->preamble
- ? "# Preamble by $top_class $top_version\n" . $self->preamble
- : '';
- my $postamble = "# Postamble by $top_class $top_version\n" .
- ($self->postamble || '');
+ ? "# Preamble by $top_class $top_version\n"
+ . $self->preamble
+ : '';
+ my $postamble = "# Postamble by $top_class $top_version\n"
+ . ($self->postamble || '');
local *MAKEFILE;
- open MAKEFILE, '< Makefile' or die $!;
+ open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
my $makefile = do { local $/; <MAKEFILE> };
close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+ $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+ $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
- $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
- $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+ open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ print MAKEFILE "$preamble$makefile$postamble" or die $!;
+ close MAKEFILE or die $!;
- open MAKEFILE, '> Makefile' or die $!;
- print MAKEFILE "$preamble$makefile$postamble" or die $!;
- close MAKEFILE or die $!;
-
1;
}
@@ -167,6 +182,8 @@
__END__
+=pod
+
=head1 NAME
Module::Install::MakeMaker - Extension Rules for ExtUtils::MakeMaker
@@ -273,7 +290,7 @@
=head1 SEE ALSO
-L<Module::Install>, L<CPAN::MakeMaker>, L<CPAN::MakeMaker-Philosophy>
+L<Module::Install>, L<CPAN::MakeMaker>, L<CPAN::MakeMaker::Philosophy>
=head1 AUTHORS
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Metadata.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Metadata.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Metadata.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw{Module::Install::Base};
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict 'vars';
@@ -160,7 +160,9 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return @{ $self->{values}{features} };
+ return $self->{values}->{features}
+ ? @{ $self->{values}->{features} }
+ : ();
}
sub no_index {
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/PAR.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/PAR.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/PAR.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
@@ -43,7 +43,7 @@
# --- $class section:
all ::
-\t\@$perl -M$inc_class -e \"extract_par(q($file))\"
+\t\$(NOECHO) $perl -M$inc_class -e \"extract_par(q($file))\"
END_MAKEFILE
@@ -51,10 +51,10 @@
# --- $class section:
$file: all test
-\t\@\$(PERL) -M$inc_class -e \"make_par(q($file))\"
+\t\$(NOECHO) \$(PERL) -M$inc_class -e \"make_par(q($file))\"
par :: $file
-\t\@\$(NOOP)
+\t\$(NOECHO) \$(NOOP)
par-upload :: $file
\tcpan-upload -verbose $file
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Run.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Run.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Run.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
# eventually move the ipc::run / open3 stuff here.
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Scripts.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Scripts.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Scripts.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
use File::Basename ();
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Share.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Share.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Share.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,11 +1,12 @@
package Module::Install::Share;
-use Module::Install::Base;
- at ISA = qw(Module::Install::Base);
+BEGIN {
+ $VERSION = '0.59';
+ @ISA = qw{Module::Install::Base};
+}
-$VERSION = '0.57';
-
use strict;
+use Module::Install::Base;
sub install_share {
my ($self, $dir) = @_;
@@ -31,7 +32,7 @@
=head1 NAME
-Module::Install::Share - Install non-code files for use during runtime
+Module::Install::Share - Install non-code files for use during run-time
=head1 SYNOPSIS
@@ -58,8 +59,32 @@
To locate the files after installation so they can be used inside your
module, see this extension's companion module L<File::ShareDir>.
+=head1 TO DO
+
+Currently C<install_share> installs not only the files you want, but
+if called by the author will also copy F<.svn> and other source-control
+directories, and other junk.
+
+Enhance this to copy only files under F<share> that are in the
+F<MANIFEST>, or possibly those not in F<MANIFEST.SKIP>.
+
+=head1 AUTHORS
+
+Audrey Tang E<lt>autrijus at autrijus.orgE<gt>
+
+Adam Kennedy E<lt>cpan at ali.asE<gt>
+
=head1 SEE ALSO
L<Module::Install>, L<File::ShareDir>
+=head1 COPYRIGHT
+
+Copyright 2006 Audrey Tang, Adam Kennedy. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+See L<http://www.perl.com/perl/misc/Artistic.html>
+
=cut
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/Win32.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/Win32.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/Win32.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install/WriteAll.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install/WriteAll.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install/WriteAll.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -3,7 +3,7 @@
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
-$VERSION = '0.57';
+$VERSION = '0.59';
use strict;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -11,11 +11,12 @@
# 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.57';
+ $VERSION = '0.59';
}
# inc::Module::Install must be loaded first
-unless ( $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'} ) {
+my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
+unless ( $INC{$file} ) {
die <<"END_DIE";
Please invoke ${\__PACKAGE__} with:
@@ -34,21 +35,20 @@
use FindBin;
*inc::Module::Install::VERSION = *VERSION;
- at inc::Module::Install::ISA = 'Module::Install';
+ at inc::Module::Install::ISA = __PACKAGE__;
sub autoload {
- my $self = shift;
- my $caller = $self->_caller;
- my $cwd = Cwd::cwd();
- my $sym = "$caller\::AUTOLOAD";
-
+ my $self = shift;
+ my $who = $self->_caller;
+ my $cwd = Cwd::cwd();
+ my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
# delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
- $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller - $sym";
+ $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
unshift @_, ($self, $1);
goto &{$self->can('call')} unless uc($1) eq $1;
};
@@ -57,18 +57,18 @@
sub import {
my $class = shift;
my $self = $class->new(@_);
+ my $who = $self->_caller;
unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
- $self->{admin} =
- "$self->{name}::$self->{dispatch}"->new(_top => $self);
+ $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
- *{$self->_caller . "::AUTOLOAD"} = $self->autoload;
+ *{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
@@ -94,18 +94,18 @@
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
- next unless defined *{$glob}{CODE};
+ next unless exists &{ref($obj).'::'.$method};
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
}
- my $caller = $self->_caller;
+ my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
- *{"${caller}::$name"} = sub {
- ${"${caller}::AUTOLOAD"} = "${caller}::$name";
- goto &{"${caller}::AUTOLOAD"};
+ *{"${who}::$name"} = sub {
+ ${"${who}::AUTOLOAD"} = "${who}::$name";
+ goto &{"${who}::AUTOLOAD"};
};
}
}
@@ -123,30 +123,26 @@
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
- $args{author} ||= '.author';
+ $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
$args{bundle} ||= 'inc/BUNDLES';
$args{base} ||= $base_path;
-
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
-
unless ( $args{path} ) {
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
- bless(\%args, $class);
+ bless \%args, $class;
}
sub call {
- my $self = shift;
- my $method = shift;
- my $obj = $self->load($method) or return;
-
- unshift @_, $obj;
- goto &{$obj->can($method)};
+ my ($self, $method) = @_;
+ my $obj = $self->load($method) or return;
+ splice(@_, 0, 2, $obj);
+ goto &{$obj->can($method)};
}
sub load {
@@ -172,13 +168,14 @@
}
sub load_extensions {
- my ($self, $path, $top_obj) = @_;
+ my ($self, $path, $top) = @_;
- unshift @INC, $self->{prefix}
- unless grep { $_ eq $self->{prefix} } @INC;
+ unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unshift @INC, $self->{prefix};
+ }
local @INC = ($path, @INC);
- foreach my $rv ($self->find_extensions($path)) {
+ foreach my $rv ( $self->find_extensions($path) ) {
my ($file, $pkg) = @{$rv};
next if $self->{pathnames}{$pkg};
@@ -189,7 +186,7 @@
next;
}
$self->{pathnames}{$pkg} = delete $INC{$file};
- push @{$self->{extensions}}, &{$new}($pkg, _top => $top_obj );
+ push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
}
$self->{extensions} ||= [];
@@ -202,10 +199,32 @@
File::Find::find( sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
- return if $1 eq $self->{dispatch};
+ my $subpath = $1;
+ return if lc($subpath) eq lc($self->{dispatch});
- $file = "$self->{path}/$1.pm";
- my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
+ $file = "$self->{path}/$subpath.pm";
+ my $pkg = "$self->{name}::$subpath";
+ $pkg =~ s!/!::!g;
+
+ # If we have a mixed-case package name, assume case has been preserved
+ # correctly. Otherwise, root through the file to locate the case-preserved
+ # version of the package name.
+ if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
+ open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
+ my $in_pod = 0;
+ while ( <PKGFILE> ) {
+ $in_pod = 1 if /^=\w/;
+ $in_pod = 0 if /^=cut/;
+ next if ($in_pod || /^=cut/); # skip pod text
+ next if /^\s*#/; # and comments
+ if ( m/^\s*package\s+($pkg)\s*;/i ) {
+ $pkg = $1;
+ last;
+ }
+ }
+ close PKGFILE;
+ }
+
push @found, [ $file, $pkg ];
}, $path ) if -d $path;
@@ -213,15 +232,13 @@
}
sub _caller {
- my $depth = 0;
- my $caller = caller($depth);
-
- while ($caller eq __PACKAGE__) {
+ my $depth = 0;
+ my $call = caller($depth);
+ while ( $call eq __PACKAGE__ ) {
$depth++;
- $caller = caller($depth);
+ $call = caller($depth);
}
-
- $caller;
+ return $call;
}
1;
Modified: packages/libmodule-install-perl/trunk/lib/Module/Install.pod
===================================================================
--- packages/libmodule-install-perl/trunk/lib/Module/Install.pod 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/Module/Install.pod 2006-03-07 15:36:06 UTC (rev 2259)
@@ -4,11 +4,6 @@
Module::Install - Standalone, extensible Perl module installer
-=head1 VERSION
-
-This document describes version 0.56 of Module::Install, released
-February 12 2006.
-
=head1 SYNOPSIS
In your F<Makefile.PL>: (Recommended Usage)
@@ -25,9 +20,9 @@
requires 'File::Spec' => '0.80';
build_requires 'Test::More' => '0.42';
recommends 'Your::OtherModule' => '0.01';
-
- no_index directory => 'demos';
+ no_index 'directory' => 'demos';
+
install_script 'bin/myscript';
auto_install;
Modified: packages/libmodule-install-perl/trunk/lib/inc/Module/Install.pm
===================================================================
--- packages/libmodule-install-perl/trunk/lib/inc/Module/Install.pm 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/lib/inc/Module/Install.pm 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,6 +1,17 @@
package inc::Module::Install;
-if (-d 'inc/.author') {
+use strict;
+
+use vars qw{$VERSION @ISA};
+BEGIN {
+ $VERSION = '0.59';
+
+ # Pass ->import to Module::Install
+ @ISA = qw{Module::Install};
+}
+
+my $author = $^O eq 'VMS' ? './inc/_author' : './inc/.author';
+if ( -d $author ) {
require File::Path;
File::Path::rmtree('inc');
}
@@ -8,10 +19,17 @@
unshift @INC, 'inc';
require Module::Install;
+# Check the versions match
+unless ( $Module::Install::VERSION and $Module::Install::VERSION eq $VERSION ) {
+ die "inc::Module::Install $VERSION loaded Module::Install $Module::Install::VERSION. Version mismatch";
+}
+
1;
__END__
+=pod
+
=head1 NAME
inc::Module::Install - Module::Install loader
@@ -40,7 +58,7 @@
CPAN distribution will be called C<Something::inc>, so it's much safer
to use.
-Also, it allows for other helper modules like B<ExtUtils::AutoInstall>
+Also, it allows for other helper modules like B<Module::AutoInstall>
to reside also in F<inc/>, and to make use of them.
=head1 AUTHORS
Copied: packages/libmodule-install-perl/trunk/t/01_compile.t (from rev 2258, packages/libmodule-install-perl/branches/upstream/current/t/01_compile.t)
Copied: packages/libmodule-install-perl/trunk/t/02_basic.t (from rev 2258, packages/libmodule-install-perl/branches/upstream/current/t/02_basic.t)
Copied: packages/libmodule-install-perl/trunk/t/03_audotinstall.t (from rev 2258, packages/libmodule-install-perl/branches/upstream/current/t/03_audotinstall.t)
Deleted: packages/libmodule-install-perl/trunk/t/1-basic.t
===================================================================
--- packages/libmodule-install-perl/trunk/t/1-basic.t 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/t/1-basic.t 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,80 +0,0 @@
-use Test;
-use File::Spec;
-
-plan(tests => 4);
-
-ok(TestHelper->create_dist('Foo'));
-ok(TestHelper->build_dist('Foo'));
-ok(-f File::Spec->catfile(qw(t Foo inc Module Install.pm)));
-ok(TestHelper->kill_dist('Foo'));
-
-package TestHelper;
-BEGIN {$^W = 1};
-use strict;
-use File::Spec;
-use File::Path;
-use Cwd;
-use Config;
-
-sub create_dist {
- my ($self, $dist) = @_;
- my $dist_path = File::Spec->catdir('t', $dist);
- return 0 if -d $dist_path;
- my $home = cwd;
- mkdir($dist_path, 0777) or return 0;
- chdir $dist_path or return 0;
-
- open MANIFEST, '> MANIFEST' or return 0;
- print MANIFEST <<END;
-MANIFEST
-Makefile.PL
-$dist.pm
-END
- close MANIFEST;
-
- open MAKEFILE_PL, '> Makefile.PL' or return 0;
- print MAKEFILE_PL <<END;
-use inc::Module::Install;
-license 'perl';
-WriteMakefile;
-END
- close MAKEFILE_PL;
-
- open MODULE, "> $dist.pm" or return 0;
- print MODULE <<END;
-package $dist;
-\$VERSION = '3.21';
-use strict;
-
-1;
-__END__
-=head1 NAME
-
-$dist - A test module
-
-=cut
-END
- close MODULE;
- chdir $home or return 0;
- return 1;
-}
-
-sub build_dist {
- my ($self, $dist) = @_;
- my $dist_path = File::Spec->catdir('t', $dist);
- return 0 unless -d $dist_path;
- my $home = cwd;
- chdir $dist_path or return 0;
- system($^X, "-Ilib", "-Iblib/lib", "Makefile.PL") == 0 or return 0;
- chdir $home or return 0;
- return 1;
-}
-
-sub kill_dist {
- my ($self, $dist) = @_;
- my $dist_path = File::Spec->catdir('t', $dist);
- File::Path::rmtree($dist_path) or return 0;
- return 1;
-}
-
-1;
Deleted: packages/libmodule-install-perl/trunk/t/2-pod.t
===================================================================
--- packages/libmodule-install-perl/trunk/t/2-pod.t 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/t/2-pod.t 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,16 +0,0 @@
-if ( !$ENV{TEST_POD} ) {
- print "1..0 # Skip set TEST_POD to enable this test\n";
- exit;
-}
-
-eval "
-use Test::More;
-use Test::Pod 1.14
-";
-
-if ( $@ ) {
- print "1..0 # Skip Test::More and Test::Pod 1.14 required - $@\n";
- exit;
-}
-
-all_pod_files_ok();
Deleted: packages/libmodule-install-perl/trunk/t/3-autoinstall.t
===================================================================
--- packages/libmodule-install-perl/trunk/t/3-autoinstall.t 2006-03-07 15:34:14 UTC (rev 2258)
+++ packages/libmodule-install-perl/trunk/t/3-autoinstall.t 2006-03-07 15:36:06 UTC (rev 2259)
@@ -1,106 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 6; $^W = 0; };
-
-# Intercepts calls to WriteMakefile and prompt.
-my $mm_args;
-my @prompts = qw/y n n y y/;
-
-use ExtUtils::MakeMaker;
-sub ExtUtils::MakeMaker::WriteMakefile { $mm_args = {@_} }
-sub ExtUtils::MakeMaker::prompt ($;$) { return 'n' }
-
-# tiehandle trick to intercept STDOUT.
-sub PRINT { my $self = shift; $$self .= join '', @_; }
-sub PRINTF { my $self = shift; $$self .= sprintf(shift, @_); }
-sub TIEHANDLE { my $self = ''; return bless \$self, shift; }
-sub READ {} sub READLINE {} sub GETC {} sub FILENO {}
-
-require Symbol;
-my $fh = Symbol::gensym;
-my $out = tie *$fh, __PACKAGE__;
-select(*$fh);
-
-# test from a clean state
-$ENV{PERL_AUTOINSTALL} = '';
-require Module::AutoInstall;
-Module::AutoInstall::_accept_default(0);
-*Module::AutoInstall::_prompt = sub {
- ok($_[1], shift(@prompts));
- return 'n';
-};
-
-# calls the module.
-ok(eval <<'.', $@);
-use Module::AutoInstall (
- -version => '0.21', # Module::AutoInstall version
- -config => {
- make_args => '--hello' # option(s) for CPAN::Config
- },
- -core => [ # core modules
- Package0 => '', # any version would do
- ],
- 'Feature1' => [
- # do we want to install this feature by default?
- -default => 0,
- Package1 => '0.01',
- ],
- 'Feature2' => [
- # associate tests to be disabled along with this
- -tests => [ $0 ],
- Package2 => '0.02',
- ],
- 'Feature3' => { # hash reference works, too
- Package3 => '0.03',
- },
-); '';
-.
-
-# simulates a makefile.
-WriteMakefile(
- AUTHOR => 'Zoe Hacker <joe at hacker.org>',
- ABSTRACT => 'Perl Interface to Zoe Hacker',
- NAME => 'Zoe::Hacker',
- VERSION_FROM => 'Hacker.pm',
- DISTNAME => 'Zoe-Hacker',
- EXE_FILES => [ qw/foo bar baz/ ],
-);
-
-# XXX - test currently disabled in anticipation of a
-# rewrite using Test::MockObject.
-
-__END__
-use Data::Dumper;
-
-$$out =~ s/.*\n//; # strip the version-dependent line.
-
-ok($$out =~ /\Q*** Checking for dependencies...
-[Core Features]
-- Package0 ...failed! (needed)
-[Feature1]
-- Package1 ...failed! (needs 0.01)
-[Feature2]
-- Package2 ...failed! (needs 0.02)
-[Feature3]
-- Package3 ...failed! (needs 0.03)\E
-.*\Q
-*** Module::AutoInstall configuration finished.\E/s);
-
-use vars qw/@Data_Stack $DNE/;
-$mm_args->{test}{TESTS} = ''; # XXX: workaround false-positive globbing
-
-ok(
- Data::Dumper::Dumper($mm_args),
- Data::Dumper::Dumper({
- ABSTRACT => 'Perl Interface to Zoe Hacker',
- test => { 'TESTS' => '' },
- NAME => 'Zoe::Hacker',
- DISTNAME => 'Zoe-Hacker',
- AUTHOR => 'Zoe Hacker (joe at hacker.org)',
- EXE_FILES => [],
- VERSION_FROM => 'Hacker.pm',
- })
-);
Copied: packages/libmodule-install-perl/trunk/t/99_pod.t (from rev 2258, packages/libmodule-install-perl/branches/upstream/current/t/99_pod.t)
More information about the Pkg-perl-cvs-commits
mailing list