Subject: | YAML parsing error should just be warning (patch included) |
The META.yml file is used if present, but is not mandatory. Therefore,
if there is an error parsing META.yml this should just be a warning.
(For an example package that cpanflute2 fails to build, see
Devel-FastProf-0.08.tar.gz from CPAN.)
Here's a patch:
--- cpanflute2~ 2008-02-05 13:50:07.000000000 +0000
+++ cpanflute2 2008-06-16 11:23:32.000000000 +0100
@@ -165,13 +165,21 @@
my $tar = new Archive::Tar;
$tar->read("$tmpdir/$tarball", 1);
my $contents = $tar->get_content($_);
- my $yaml = Load($contents);
+ my $yaml;
+ eval {
+ my $yaml = Load($contents);
+ };
- while (my ($mod, $ver) = each %{$yaml->{build_requires}}) {
- push @build_requires, [ make_prereq_name($mod), $ver ];
+ if ($@) {
+ warn $@;
}
- while (my ($mod, $ver) = each %{$yaml->{requires}}) {
- push @requires, [ make_prereq_name($mod), $ver ];
+ else {
+ while (my ($mod, $ver) = each %{$yaml->{build_requires}}) {
+ push @build_requires, [ make_prereq_name($mod), $ver ];
+ }
+ while (my ($mod, $ver) = each %{$yaml->{requires}}) {
+ push @requires, [ make_prereq_name($mod), $ver ];
+ }
}
}