diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-06-03T13·19+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-06-03T13·19+0200 |
commit | a64da5915d4023d256e1bda425ea6e10c1255812 (patch) | |
tree | 470a9bc2edea827e66a17cadf08c00a8d19f07bc /perl/lib | |
parent | f0f30f594c0e1ebe06c4ff26afef00a0b212f62a (diff) |
Be more robust wrt broken .narinfo files
Diffstat (limited to 'perl/lib')
-rw-r--r-- | perl/lib/Nix/Manifest.pm | 13 |
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"; |