about summary refs log tree commit diff
path: root/perl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-03T13·19+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-03T13·19+0200
commita64da5915d4023d256e1bda425ea6e10c1255812 (patch)
tree470a9bc2edea827e66a17cadf08c00a8d19f07bc /perl
parentf0f30f594c0e1ebe06c4ff26afef00a0b212f62a (diff)
Be more robust wrt broken .narinfo files
Diffstat (limited to 'perl')
-rw-r--r--perl/lib/Nix/Manifest.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/perl/lib/Nix/Manifest.pm b/perl/lib/Nix/Manifest.pm
index 93c9c261ddc9..fb4a46469a09 100644
--- a/perl/lib/Nix/Manifest.pm
+++ b/perl/lib/Nix/Manifest.pm
@@ -462,9 +462,16 @@ sub parseNARInfo {
             return undef;
         }
 
-        my $fingerprint = fingerprintPath(
-            $storePath, $narHash, $narSize,
-            [ map { "$Nix::Config::storeDir/$_" } @refs ]);
+        my $fingerprint;
+        eval {
+            $fingerprint = fingerprintPath(
+                $storePath, $narHash, $narSize,
+                [ map { "$Nix::Config::storeDir/$_" } @refs ]);
+        };
+        if ($@) {
+            warn "cannot compute fingerprint of ‘$location’; ignoring\n";
+            return undef;
+        }
 
         if (!checkSignature($publicKey, decode_base64($sig64), $fingerprint)) {
             warn "NAR info file ‘$location’ has an incorrect signature; ignoring\n";