From: Darold Gilles Date: Sat, 8 Feb 2014 08:46:20 +0000 (+0100) Subject: Fix Makefile error, "WriteMakefile: Need even number of args at Makefile.PL" with... X-Git-Tag: v5.1~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0313c1f2c75dd8600daf3f25edc11fc46c3cf30f;p=pgbadger Fix Makefile error, "WriteMakefile: Need even number of args at Makefile.PL" with perl 5.8. Thanks to Fangr Zhang for the report. --- diff --git a/Makefile.PL b/Makefile.PL index f433030..a5dc423 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -18,6 +18,22 @@ $ENV{DESTDIR} =~ s/\/$//; # Default install path my $DESTDIR = $ENV{DESTDIR} || ''; my $INSTALLDIRS = $ENV{INSTALLDIRS} || 'site'; +my %merge_compat = (); + +if ($ExtUtils::MakeMaker::VERSION >= 6.46) { + %merge_compat = ( + 'META_MERGE' => { + resources => { + homepage => 'http://projects.dalibo.org/pgbadger', + repository => { + type => 'git', + git => 'git@github.com:dalibo/pgbadger.git', + web => 'https://github.com/dalibo/pgbadger', + }, + }, + } + ); +} WriteMakefile( 'DISTNAME' => 'pgbadger', @@ -34,16 +50,6 @@ WriteMakefile( 'DESTDIR' => $DESTDIR, 'INSTALLDIRS' => $INSTALLDIRS, 'clean' => {}, - ($ExtUtils::MakeMaker::VERSION < 6.46 ? () : 'META_MERGE' => { - resources => { - homepage => 'http://projects.dalibo.org/pgbadger', - repository => { - type => 'git', - git => 'git@github.com:dalibo/pgbadger.git', - web => 'https://github.com/dalibo/pgbadger', - }, - }, - } - ) + %merge_compat );