On Nov 5, 2007, at 5:24 PM, John Peacock wrote:
Further studying makes it obvious that, since this box doesn't have
Module::Build installed, CPAN is using the compatibility
Makefile.PL, which is
what is emitting the above message. So it isn't anything to do
with CPAN, as I
can recreate the same bad behavior outside of CPAN:
$ make install INSTALLDIRS=vendor DESTDIR=/tmp/mbtest
/usr/bin/perl Build --makefile_env_macros 1 install
Odd number of elements in hash assignment at lib/Module/Build/
Base.pm line 1693.
I tried to write a test case for this, but for some reason it's not
working. Here's my first attempt:
===================================================================
--- t/compat.t (revision 10194)
+++ t/compat.t (working copy)
@@ -18,7 +18,7 @@
#find_in_path does not understand VMS.
if ( $Config{make} && $^O ne 'VMS' ? find_in_path($Config{make}) :
1 ) {
- plan tests => 37 + @makefile_types*$tests_per_type*2;
+ plan tests => 39 + @makefile_types*$tests_per_type*2;
} else {
plan skip_all => "Don't know how to invoke 'make'";
}
@@ -214,6 +214,16 @@
qr/(?:# .+basic\.+ok\s+(?:[\d.]+\s*m?s\s*)?)# All tests/,
'Should be non-verbose';
+ $output = stdout_of( sub {
+ $ran_ok = $mb->do_system(@make, 'fakeinstall',
'INSTALLDIRS=vendor')
+ } );
+
+ ok $ran_ok, "make fakeinstall with INSTALLDIRS=vendor ran ok";
+ $output =~ s/^/# /gm; # Don't confuse our own test output
+ like $output,
+ qr/foo/,
+ 'Should have installdirs=vendor';
+
stdout_of( sub { $mb->do_system(@make, 'realclean'); } );
ok ! -e $makefile, "$makefile shouldn't exist";
===================================================================
Anyone want to have a go at massaging things to get it working?
I've checked in a fix just now, but would like to have a test case too.
-Ken