Subject: | Makefile parser gets confused |
Date: | Wed, 4 Mar 2015 21:20:46 +0000 |
To: | "bug-PPM-Make [...] rt.cpan.org" <bug-PPM-Make [...] rt.cpan.org> |
From: | "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de> |
Hi,
I can't make_ppm Switch::Plain 0.03. I get the error:
Bareword found where operator expected at (eval 96) line 1, near "$(OBJECT"
(Missing operator before OBJECT?)
Eval of Makefile failed: syntax error at (eval 96) line 1, near "$(OBJECT"
Obviously the depend-Line in
# MakeMaker Parameters:
# ABSTRACT_FROM => q[lib/Switch/Plain.pm]
...
# TEST_REQUIRES => { Test::More=>q[0] }
# VERSION_FROM => q[lib/Switch/Plain.pm]
# clean => { FILES=>q[Switch-Plain-*] }
# depend => { $(OBJECT)=>q[hax/block_end.c.inc hax/block_start.c.inc hax/COP_SEQ_RANGE_HIGH_set.c.inc hax/COP_SEQ_RANGE_LOW_set.c.inc hax/intro_my.c.inc hax/pad_block_start.c.inc hax/pad_leavemy.c.inc hax/scalar.c.inc hax/scalarseq.c.inc], Makefile=>q[$(VERSION_FROM)] }
# dist => { SUFFIX=>q[gz], COMPRESS=>q[gzip -9f] }
# --- MakeMaker post_initialize section:
is the problem, because it contains the string VERSION_FROM and is copied into the eval string. This seems like the same problem once solved for MAN3PODS.
--- lib\PPM\Make\Meta.pm.orig 2015-03-04 21:49:24.988658000 +0100
+++ lib\PPM\Make\Meta.pm 2015-03-04 21:51:21.737658000 +0100
@@ -151,10 +151,11 @@
next unless /$re/;
# Skip MAN3PODS that can appear here if some words from @wanted found
next if /^#\s+MAN3PODS => /;
chomp;
s/^#*\s+// or next;
+ next unless /^(?:$re)\s*\=\>/o;
push @lines, $_;
}
close($fh);
my $make = join ',', @lines;
$make = '(' . $make . ')';
fixed PPM-Make 0.9902 for me, but of course there may be a better solution, e.g. combining all the regexp matches into one (next unless /^#\s+(?:$re)\s*\=\>/o;).
Ralf