mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Add function to extract hash part of a store path
This commit is contained in:
parent
74f954ee62
commit
d089372565
3 changed files with 15 additions and 2 deletions
|
@ -61,7 +61,14 @@ Path followLinksToStorePath(const Path & path)
|
|||
string storePathToName(const Path & path)
|
||||
{
|
||||
assertStorePath(path);
|
||||
return string(path, settings.nixStore.size() + 34);
|
||||
return string(path, settings.nixStore.size() + storePathHashLen + 2);
|
||||
}
|
||||
|
||||
|
||||
string storePathToHash(const Path & path)
|
||||
{
|
||||
assertStorePath(path);
|
||||
return string(path, settings.nixStore.size() + 1, storePathHashLen);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue