mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Use ContentAddressMethod::render
in one more place
Good to deduplicate the code.
This commit is contained in:
parent
41dd9857c7
commit
db41a0616a
1 changed files with 2 additions and 16 deletions
|
@ -21,23 +21,9 @@ StorePath fetchToStore(
|
||||||
cacheKey = fetchers::Attrs{
|
cacheKey = fetchers::Attrs{
|
||||||
{"_what", "fetchToStore"},
|
{"_what", "fetchToStore"},
|
||||||
{"store", store.storeDir},
|
{"store", store.storeDir},
|
||||||
{"name", std::string(name)},
|
{"name", std::string{name}},
|
||||||
{"fingerprint", *path.accessor->fingerprint},
|
{"fingerprint", *path.accessor->fingerprint},
|
||||||
{
|
{"method", std::string{method.render()}},
|
||||||
"method",
|
|
||||||
std::visit(overloaded {
|
|
||||||
[](const TextIngestionMethod &) {
|
|
||||||
return "text";
|
|
||||||
},
|
|
||||||
[](const FileIngestionMethod & fim) {
|
|
||||||
switch (fim) {
|
|
||||||
case FileIngestionMethod::Flat: return "flat";
|
|
||||||
case FileIngestionMethod::Recursive: return "nar";
|
|
||||||
default: assert(false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}, method.raw),
|
|
||||||
},
|
|
||||||
{"path", path.path.abs()}
|
{"path", path.path.abs()}
|
||||||
};
|
};
|
||||||
if (auto res = fetchers::getCache()->lookup(store, *cacheKey)) {
|
if (auto res = fetchers::getCache()->lookup(store, *cacheKey)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue