mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02: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
|
@ -9,6 +9,7 @@
|
|||
#include "tarball.hh"
|
||||
#include "url.hh"
|
||||
#include "value-to-json.hh"
|
||||
#include "fetch-to-store.hh"
|
||||
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
|
@ -473,7 +474,7 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
|
|||
// https://github.com/NixOS/nix/issues/4313
|
||||
auto storePath =
|
||||
unpack
|
||||
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).storePath
|
||||
? fetchToStore(*state.store, fetchers::downloadTarball(*url).accessor, FetchMode::Copy, name)
|
||||
: fetchers::downloadFile(state.store, *url, name, (bool) expectedHash).storePath;
|
||||
|
||||
if (expectedHash) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue