Subject: | Two Problems in Makefile.PL |
The attached patch fixes two problems with CPANPLUS.
Subject: | CPANPLUS-Makefile.PL-fixes.diff |
--- Makefile.PL.orig 2006-03-04 20:44:18.812177750 +0200
+++ Makefile.PL 2006-03-04 20:45:57.842366750 +0200
@@ -234,18 +234,11 @@
sub setup_needed {
my $run_setup;
- ### first, look for SETUP=1 or SETUP=yes in @ARGV
- foreach my $arg (@ARGV) {
- $run_setup = (($1 =~ /[1yY]/) ? 1 : 0)
- if $arg =~ /^SETUP=(.)/i;
- $AutoInstall = (($1 =~ /[1yY]/) ? 1 : 0)
- if $arg =~ /^AUTOINSTALL=(.)/i;
- }
+ $run_setup = $RunSetup;
+
### removes the SETUP=* and AUTOINSTALL=* to make MakeMaker happier
- if (defined $run_setup) {
- @ARGV = grep { $_ !~ /^(?:SETUP|AUTOINSTALL)=./i } @ARGV;
-
+ if (defined $run_setup) {
### can't tell from @ARGV, so ask the user instead
} else {
@@ -289,11 +282,11 @@
### no config found in the local tree, let's go looking on the rest
### of the filesystem
### silence any error coming out of this,
- eval { local $CPANPLUS::Error::ERROR_FH;
+ my $load_ret = eval { local $CPANPLUS::Error::ERROR_FH;
CPANPLUS::Configure->_load_cpanplus_config };
### so we couldn't load a suitable config ###
- return 0 if $@;
+ return 0 if ($@ || !$load_ret);
### ok, we found a config.pm, but is it a high enough version?
return 1 if CPANPLUS::Configure->_config_version_sufficient;