mirror of
https://github.com/NixOS/nix.git
synced 2025-12-02 15:11:00 +01:00
Tarball fetcher: Use the content-addressed Git cache
Backported from the lazy-trees branch.
This commit is contained in:
parent
930b9c8269
commit
cabee98152
9 changed files with 185 additions and 95 deletions
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
#include "types.hh"
|
||||
#include "path.hh"
|
||||
#include "hash.hh"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace nix {
|
||||
class Store;
|
||||
struct InputAccessor;
|
||||
}
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
|
@ -28,16 +30,18 @@ DownloadFileResult downloadFile(
|
|||
|
||||
struct DownloadTarballResult
|
||||
{
|
||||
StorePath storePath;
|
||||
Hash treeHash;
|
||||
time_t lastModified;
|
||||
std::optional<std::string> immutableUrl;
|
||||
ref<InputAccessor> accessor;
|
||||
};
|
||||
|
||||
/**
|
||||
* Download and import a tarball into the Git cache. The result is the
|
||||
* Git tree hash of the root directory.
|
||||
*/
|
||||
DownloadTarballResult downloadTarball(
|
||||
ref<Store> store,
|
||||
const std::string & url,
|
||||
const std::string & name,
|
||||
bool locked,
|
||||
const Headers & headers = {});
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue