From: Matt S Trout Date: Sun, 22 Jan 2017 13:00:51 +0000 (+0000) Subject: don't fail packlist finding if one module fails to load X-Git-Tag: v0.010007~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FApp-FatPacker.git;a=commitdiff_plain;h=de0c2ef75de79bd3eaa8f29e9f583e7e86e42981 don't fail packlist finding if one module fails to load --- diff --git a/Changes b/Changes index 639864e..4444d47 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for App-FatPacker + - don't fail packlist finding if one module fails to load - don't fail tracing w/undef INC values due to failed optional module load 0.010_006 - 2017-01-20 diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index b90a57e..db65c00 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -142,11 +142,16 @@ sub script_command_packlists_for { sub packlists_containing { my ($self, $targets) = @_; - my @targets = @$targets; + my @targets; { local @INC = ('lib', @INC); - foreach my $t (@targets) { - require $t; + foreach my $t (@$targets) { + unless (eval { require $t; 1}) { + warn "Failed to load ${t}: $@\n" + ."Make sure you're not missing a packlist as a result\n"; + next; + } + push @targets, $t; } } my @search = grep -d $_, map catdir($_, 'auto'), @INC;