scancpan: catch exception when MANIFEST is missing
authorFrancois Perrad <fperrad@gmail.com>
Sun, 20 Aug 2017 08:03:31 +0000 (10:03 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 21 Aug 2017 21:41:07 +0000 (23:41 +0200)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
utils/scancpan

index 9ccbac5a416bc043e866594ede93b6eed77a5ee6..20bd4c69334986e6b43aadae100e55b766b81c4f 100755 (executable)
@@ -567,11 +567,17 @@ sub fetch {
         say qq{fetch ${name}} unless $quiet;
         my $result = $mcpan->release( distribution => $name );
         $dist{$name} = $result;
-        my $manifest = $mcpan->source( author => $result->{author},
-                                       release => $name . q{-} . $result->{version},
-                                       path => 'MANIFEST' );
-        $need_dlopen{$name} = is_xs( $manifest );
-        $license_files{$name} = find_license_files( $manifest );
+        eval {
+            my $manifest = $mcpan->source( author => $result->{author},
+                                           release => $name . q{-} . $result->{version},
+                                           path => 'MANIFEST' );
+            $need_dlopen{$name} = is_xs( $manifest );
+            $license_files{$name} = find_license_files( $manifest );
+        };
+        if ($@) {
+            warn $@;
+            $license_files{$name} = [];
+        }
         my %build = ();
         my %runtime = ();
         my %optional = ();