1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Merge pull request #8650 from obsidiansystems/content-address-simpler

Simplify `ContentAddress`
This commit is contained in:
Eelco Dolstra 2023-07-21 13:46:53 +02:00 committed by GitHub
commit 7ac24d9525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 182 additions and 293 deletions

View file

@ -1300,9 +1300,10 @@ drvName, Bindings * attrs, Value & v)
auto method = ingestionMethod.value_or(FileIngestionMethod::Flat);
DerivationOutput::CAFixed dof {
.ca = ContentAddress::fromParts(
std::move(method),
std::move(h)),
.ca = ContentAddress {
.method = std::move(method),
.hash = std::move(h),
},
};
drv.env["out"] = state.store->printStorePath(dof.path(*state.store, drvName, "out"));
@ -2164,10 +2165,8 @@ static void addPath(
std::optional<StorePath> expectedStorePath;
if (expectedHash)
expectedStorePath = state.store->makeFixedOutputPath(name, FixedOutputInfo {
.hash = {
.method = method,
.hash = *expectedHash,
},
.method = method,
.hash = *expectedHash,
.references = {},
});