mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 06:22:42 +01:00
Unified fetcher caching system
This commit is contained in:
parent
fbcb897e21
commit
2a4e4f6a6e
20 changed files with 425 additions and 197 deletions
|
|
@ -132,10 +132,10 @@ static FlakeInput parseFlakeInput(EvalState & state,
|
|||
auto sFlake = state.symbols.create("flake");
|
||||
auto sFollows = state.symbols.create("follows");
|
||||
|
||||
fetchers::Input::Attrs attrs;
|
||||
fetchers::Attrs attrs;
|
||||
std::optional<std::string> url;
|
||||
|
||||
for (Attr attr : *(value->attrs)) {
|
||||
for (nix::Attr attr : *(value->attrs)) {
|
||||
try {
|
||||
if (attr.name == sUrl || attr.name == sUri) {
|
||||
expectType(state, tString, *attr.value, *attr.pos);
|
||||
|
|
@ -188,7 +188,7 @@ static std::map<FlakeId, FlakeInput> parseFlakeInputs(
|
|||
|
||||
expectType(state, tAttrs, *value, pos);
|
||||
|
||||
for (Attr & inputAttr : *(*value).attrs) {
|
||||
for (nix::Attr & inputAttr : *(*value).attrs) {
|
||||
inputs.emplace(inputAttr.name,
|
||||
parseFlakeInput(state,
|
||||
inputAttr.name,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ std::string FlakeRef::to_string() const
|
|||
return input->to_string();
|
||||
}
|
||||
|
||||
fetchers::Input::Attrs FlakeRef::toAttrs() const
|
||||
fetchers::Attrs FlakeRef::toAttrs() const
|
||||
{
|
||||
auto attrs = input->toAttrs();
|
||||
if (subdir != "")
|
||||
|
|
@ -168,7 +168,7 @@ std::optional<std::pair<FlakeRef, std::string>> maybeParseFlakeRefWithFragment(
|
|||
}
|
||||
}
|
||||
|
||||
FlakeRef FlakeRef::fromAttrs(const fetchers::Input::Attrs & attrs)
|
||||
FlakeRef FlakeRef::fromAttrs(const fetchers::Attrs & attrs)
|
||||
{
|
||||
auto attrs2(attrs);
|
||||
attrs2.erase("dir");
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ struct FlakeRef
|
|||
// FIXME: change to operator <<.
|
||||
std::string to_string() const;
|
||||
|
||||
fetchers::Input::Attrs toAttrs() const;
|
||||
fetchers::Attrs toAttrs() const;
|
||||
|
||||
FlakeRef resolve(ref<Store> store) const;
|
||||
|
||||
static FlakeRef fromAttrs(const fetchers::Input::Attrs & attrs);
|
||||
static FlakeRef fromAttrs(const fetchers::Attrs & attrs);
|
||||
|
||||
std::pair<fetchers::Tree, FlakeRef> fetchTree(ref<Store> store) const;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue