mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
* Remove SwitchToOriginalUser, we're not going to need it anymore.
This commit is contained in:
parent
626f8ee42f
commit
9c9cdb06d0
8 changed files with 4 additions and 63 deletions
|
@ -96,25 +96,15 @@ Path makeFixedOutputPath(bool recursive,
|
|||
std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
|
||||
bool fixed, bool recursive, string hashAlgo)
|
||||
{
|
||||
Hash h(htSHA256);
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
h = hashPath(htSHA256, srcPath);
|
||||
}
|
||||
Hash h = hashPath(htSHA256, srcPath);
|
||||
|
||||
string baseName = baseNameOf(srcPath);
|
||||
|
||||
Path dstPath;
|
||||
|
||||
if (fixed) {
|
||||
|
||||
HashType ht(parseHashType(hashAlgo));
|
||||
Hash h2(ht);
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
|
||||
}
|
||||
|
||||
Hash h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
|
||||
dstPath = makeFixedOutputPath(recursive, hashAlgo, h2, baseName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue