diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-05T14·39+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-05T14·39+0200 |
commit | b654381eb38b98aa92df343e3c4a939c1e584443 (patch) | |
tree | f9409aebdcbcad53dc88d71fc6249db0b1bc01de /src/libstore | |
parent | d0f5719c2a2e5a0eea49dc072b26e7d161564bbb (diff) |
Add "nix sign-paths" command
E.g. $ nix sign-paths -k ./secret -r $(type -p geeqie) signs geeqie and all its dependencies using the key in ./secret.
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/store-api.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index b47376e5594a..b9939feda477 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -312,6 +312,9 @@ void Store::exportPaths(const Paths & paths, std::string ValidPathInfo::fingerprint() const { + if (narSize == 0 || narHash.type == htUnknown) + throw Error(format("cannot calculate fingerprint of path ‘%s’ because its size/hash is not known") + % path); return "1;" + path + ";" + printHashType(narHash.type) + ":" + printHash32(narHash) + ";" |