mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Use designated initializers for DerivationOutputHash
This commit is contained in:
parent
237d88c97e
commit
145d88cb2a
4 changed files with 10 additions and 9 deletions
|
@ -776,7 +776,10 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
|
||||||
if (!jsonObject) drv.env["out"] = state.store->printStorePath(outPath);
|
if (!jsonObject) drv.env["out"] = state.store->printStorePath(outPath);
|
||||||
drv.outputs.insert_or_assign("out", DerivationOutput {
|
drv.outputs.insert_or_assign("out", DerivationOutput {
|
||||||
.path = std::move(outPath),
|
.path = std::move(outPath),
|
||||||
.hash = DerivationOutputHash { ingestionMethod, std::move(h) },
|
.hash = DerivationOutputHash {
|
||||||
|
.method = ingestionMethod,
|
||||||
|
.hash = std::move(h),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,8 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream
|
||||||
if (hashType == htUnknown)
|
if (hashType == htUnknown)
|
||||||
throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
|
throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
|
||||||
fsh = DerivationOutputHash {
|
fsh = DerivationOutputHash {
|
||||||
std::move(method),
|
.method = std::move(method),
|
||||||
Hash(hash, hashType),
|
.hash = Hash(hash, hashType),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,8 +424,8 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store)
|
||||||
if (hashType == htUnknown)
|
if (hashType == htUnknown)
|
||||||
throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
|
throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
|
||||||
fsh = DerivationOutputHash {
|
fsh = DerivationOutputHash {
|
||||||
std::move(method),
|
.method = std::move(method),
|
||||||
Hash(hash, hashType),
|
.hash = Hash(hash, hashType),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,6 @@ struct DerivationOutputHash {
|
||||||
: method(std::move(method))
|
: method(std::move(method))
|
||||||
, hash(std::move(hash))
|
, hash(std::move(hash))
|
||||||
{ }
|
{ }
|
||||||
DerivationOutputHash(const DerivationOutputHash &) = default;
|
|
||||||
DerivationOutputHash(DerivationOutputHash &&) = default;
|
|
||||||
DerivationOutputHash & operator = (const DerivationOutputHash &) = default;
|
|
||||||
std::string printMethodAlgo() const;
|
std::string printMethodAlgo() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,8 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
|
||||||
drv.outputs.insert_or_assign("out", DerivationOutput {
|
drv.outputs.insert_or_assign("out", DerivationOutput {
|
||||||
.path = shellOutPath,
|
.path = shellOutPath,
|
||||||
.hash = DerivationOutputHash {
|
.hash = DerivationOutputHash {
|
||||||
FileIngestionMethod::Flat, Hash { }
|
.method = FileIngestionMethod::Flat,
|
||||||
|
.hash = Hash { },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
drv.env["out"] = store->printStorePath(shellOutPath);
|
drv.env["out"] = store->printStorePath(shellOutPath);
|
||||||
|
|
Loading…
Reference in a new issue