Add function to extract hash part of a store path

This commit is contained in:
Eelco Dolstra 2016-02-15 12:49:01 +01:00
parent 74f954ee62
commit d089372565
3 changed files with 15 additions and 2 deletions

View file

@ -1064,7 +1064,7 @@ StringSet LocalStore::queryDerivationOutputNames(const Path & path)
Path LocalStore::queryPathFromHashPart(const string & hashPart)
{
if (hashPart.size() != 32) throw Error("invalid hash part");
if (hashPart.size() != storePathHashLen) throw Error("invalid hash part");
Path prefix = settings.nixStore + "/" + hashPart;