Subject: | PATCH] 2 Distribution.pm breakages on VMS |
7f2189107ab54144 added a list assignment to %ENV in CPAN::Distribution::make, which falls down hard on VMS, where list assignment to %ENV isn't safe and thus isn't allowed, even when %ENV is localizzed. There are no indications in the comments or commit message what problem this is trying to solve, so my first patch attached here makes a guess that there were uninitialized value warnings and changes the undefined values, if any, to empty strings in a localized slice of %ENV.
e55b963a6b8c8 added a check to look for 'Makefile' or 'Build' in prereq_pm and stopped looking for prerequisites if those files don't exist. That means no prerequisite processing is done for any make tool or platform that doesn't use those specific filenames. The second patch here fixes the most common cases on VMS. Windows might still be broken (at least I think there used to be 'Build.bat' -- not sure if it's still done that way). Ideally these filenames would be obtained from ExtUtils::MakeMaker->{MAKEFILE} and Module::Build->{properties}{build_script} but those are obviously not readily accessible from Distribution.pm.
Subject: | 0001-Don-t-use-list-assignment-to-ENV-in-Distribution-mak.patch |
From 76d547885bbbceba836e4e0b18fc9ba9e5ae325d Mon Sep 17 00:00:00 2001
From: "Craig A. Berry" <craigberry@mac.com>
Date: Fri, 22 Aug 2014 14:22:38 -0500
Subject: [PATCH 1/2] Don't use list assignment to %ENV in Distribution::make.
That doesn't work on VMS. We can avoid uninitialized value warnings
by replacing undefined values with empty strings and then override
only those values in %ENV rather than replacing the whole thing.
---
lib/CPAN/Distribution.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm
index b2602d4..e1df4b5 100644
--- a/lib/CPAN/Distribution.pm
+++ b/lib/CPAN/Distribution.pm
@@ -2123,10 +2123,10 @@ is part of the perl-%s distribution. To install that, you need to run
my %env;
while (my($k,$v) = each %ENV) {
- next unless defined $v;
- $env{$k} = $v;
+ next if defined $v;
+ $env{$k} = '';
}
- local %ENV = %env;
+ local @ENV{keys %env} = values %env;
my $satisfied = eval { $self->satisfy_requires };
return $self->goodbye($@) if $@;
return unless $satisfied ;
--
1.8.4.2
Subject: | 0002-Fix-Makefile-Build-file-test-in-prereq_pm.patch |
From 2c464025b08c914f4dada03a35bb4dbab8e6ae72 Mon Sep 17 00:00:00 2001
From: "Craig A. Berry" <craigberry@mac.com>
Date: Fri, 22 Aug 2014 14:33:32 -0500
Subject: [PATCH 2/2] Fix Makefile/Build file test in prereq_pm.
e55b963a6b8c8 added a check to look for 'Makefile' or 'Build' and stopped
looking for prerequisites if those files don't exist. That means no
prerequisite processing is done for any make tool or platform that doesn't
generate those specific filenames. So add at least a couple of the things
that are missing.
---
lib/CPAN/Distribution.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/CPAN/Distribution.pm b/lib/CPAN/Distribution.pm
index e1df4b5..8713d3c 100644
--- a/lib/CPAN/Distribution.pm
+++ b/lib/CPAN/Distribution.pm
@@ -3153,8 +3153,9 @@ sub prereq_pm {
return;
}
# no Makefile/Build means configuration aborted, so don't look for prereqs
- return unless -f File::Spec->catfile($self->{build_dir},'Makefile')
- || -f File::Spec->catfile($self->{build_dir},'Build');
+ my $makefile = File::Spec->catfile($self->{build_dir}, $^O eq 'VMS' ? 'descrip.mms' : 'Makefile');
+ my $buildfile = File::Spec->catfile($self->{build_dir}, $^O eq 'VMS' ? 'Build.com' : 'Build');
+ return unless -f $makefile || -f $buildfile;
CPAN->debug(sprintf "writemakefile[%s]modulebuild[%s]",
$self->{writemakefile}||"",
$self->{modulebuild}||"",
--
1.8.4.2