mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 14:02:42 +01:00
More designated initializers
This commit is contained in:
parent
2f0e395c99
commit
911fc88bcb
6 changed files with 19 additions and 10 deletions
|
|
@ -3764,7 +3764,10 @@ void DerivationGoal::registerOutputs()
|
|||
else
|
||||
assert(worker.store.parseStorePath(path) == dest);
|
||||
|
||||
ca = FixedOutputHash { i.second.hash->method, h2 };
|
||||
ca = FixedOutputHash {
|
||||
.method = i.second.hash->method,
|
||||
.hash = h2,
|
||||
};
|
||||
}
|
||||
|
||||
/* Get rid of all weird permissions. This also checks that
|
||||
|
|
|
|||
|
|
@ -55,10 +55,16 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
|
|||
auto methodAndHash = rawCa.substr(prefixSeparator+1, string::npos);
|
||||
if (methodAndHash.substr(0,2) == "r:") {
|
||||
std::string_view hashRaw = methodAndHash.substr(2,string::npos);
|
||||
return FixedOutputHash { FileIngestionMethod::Recursive, Hash(string(hashRaw)) };
|
||||
return FixedOutputHash {
|
||||
.method = FileIngestionMethod::Recursive,
|
||||
.hash = Hash(string(hashRaw)),
|
||||
};
|
||||
} else {
|
||||
std::string_view hashRaw = methodAndHash;
|
||||
return FixedOutputHash { FileIngestionMethod::Flat, Hash(string(hashRaw)) };
|
||||
return FixedOutputHash {
|
||||
.method = FileIngestionMethod::Flat,
|
||||
.hash = Hash(string(hashRaw)),
|
||||
};
|
||||
}
|
||||
} else {
|
||||
throw Error("parseContentAddress: format not recognized; has to be text or fixed");
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ StorePath LocalStore::addToStoreFromDump(const string & dump, const string & nam
|
|||
ValidPathInfo info(dstPath);
|
||||
info.narHash = hash.first;
|
||||
info.narSize = hash.second;
|
||||
info.ca = FixedOutputHash { method, h };
|
||||
info.ca = FixedOutputHash { .method = method, .hash = h };
|
||||
registerValidPath(info);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue