Permalink
Browse files

use Module::Depends::Instrusive if Module::Depends fails parsing META…

….yml
  • Loading branch information...
dann committed Jan 30, 2010
1 parent be25218 commit e0decc1455122385359bc5241265508e32aa018f
View
@@ -41,6 +41,7 @@ requires(
'IPC::Cmd' => 0,
'CPAN::DistnameInfo' => 0,
'Log::Log4perl' => '1.26',
+ 'Try::Tiny' => '0.04',
);
features(
View
@@ -1,7 +1,5 @@
---
global:
- fix_meta_yml_modules:
- - HTTP::Request::AsCGI
fix_module_name:
- from: Template::Toolkit
to: Template
View
@@ -2,10 +2,6 @@
global:
cpan_mirrors:
- file:///home/dann/minicpan/
- fix_meta_yml_modules:
- - YAML
- - Class::Member
- - HTTP::Request::AsCGI
fix_module_name:
- from: Class::Classgen::classgen
to: Class::Classgen::Attribute
@@ -73,7 +73,7 @@ sub build {
$self->copy_module_sources_to_build_dir($module);
my $is_failed = $self->build_rpm_package($spec_file_name);
$self->install($module) unless $is_failed;
- INFO(">>> finished building rpm package ( $module->{module} )");
+ INFO(">>> Finished building rpm package ( $module->{module} )");
return $self->get_package_name($module);
}
@@ -35,16 +35,6 @@ which is passed to cpan-packager script.
type: seq
sequence:
- type: str
- "fix_meta_yml_modules":
- type: seq
- sequence:
- - type: str
- unique: yes
- "fix_meta_yml_modules":
- type: seq
- sequence:
- - type: str
- unique: yes
"fix_package_depends":
type: seq
sequence:
@@ -11,6 +11,7 @@ use CPAN::Packager::Extractor;
use List::MoreUtils qw(uniq any);
use FileHandle;
use Log::Log4perl qw(:easy);
+use Try::Tiny;
has 'downloader' => (
is => 'rw',
@@ -231,15 +232,15 @@ sub get_dependencies {
@{ $config->{modules}->{$module}->{depends} };
}
- my $make_yml_generate_fg = any { $_ eq $module }
- @{ $config->{global}->{fix_meta_yml_modules} || [] };
-
DEBUG("Start analyzing dependencies with Module::Depends");
- my $depends_mod
- = $make_yml_generate_fg
- ? "Module::Depends::Intrusive"
- : "Module::Depends";
- my $deps = $depends_mod->new->dist_dir($src)->find_modules;
+
+ my $deps;
+ try {
+ $deps = Module::Depends->new->dist_dir($src)->find_modules;
+ } catch {
+ $deps = Module::Depends::Intrusive->new->dist_dir($src)->find_modules;
+ };
+
DEBUG("Finish analyzing dependencies with Module::Depends");
return grep { !$self->is_added($_) }

0 comments on commit e0decc1

Please sign in to comment.