mirror of
https://github.com/NixOS/nix
synced 2025-07-06 00:51:47 +02:00
Merge pull request #10152 from edolstra/fetcher-cleanups
Fetcher cleanups
This commit is contained in:
commit
7d76bc8a39
12 changed files with 112 additions and 71 deletions
|
@ -1,6 +1,8 @@
|
|||
#include "fetchers.hh"
|
||||
#include "store-api.hh"
|
||||
#include "archive.hh"
|
||||
#include "fs-input-accessor.hh"
|
||||
#include "posix-source-accessor.hh"
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
||||
|
@ -102,7 +104,7 @@ struct PathInputScheme : InputScheme
|
|||
throw Error("cannot fetch input '%s' because it uses a relative path", input.to_string());
|
||||
}
|
||||
|
||||
std::pair<StorePath, Input> fetch(ref<Store> store, const Input & _input) override
|
||||
std::pair<ref<InputAccessor>, Input> getAccessor(ref<Store> store, const Input & _input) const override
|
||||
{
|
||||
Input input(_input);
|
||||
std::string absPath;
|
||||
|
@ -144,7 +146,7 @@ struct PathInputScheme : InputScheme
|
|||
}
|
||||
input.attrs.insert_or_assign("lastModified", uint64_t(mtime));
|
||||
|
||||
return {std::move(*storePath), input};
|
||||
return {makeStorePathAccessor(store, *storePath), std::move(input)};
|
||||
}
|
||||
|
||||
std::optional<std::string> getFingerprint(ref<Store> store, const Input & input) const override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue