don't fail packlist finding if one module fails to load
[p5sagit/App-FatPacker.git] / lib / App / FatPacker.pm
index b90a57e..db65c00 100644 (file)
@@ -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;