1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Get rid of downloadCached()

Everything uses the generic caching system now.
This commit is contained in:
Eelco Dolstra 2020-03-18 17:23:56 +01:00
parent c5ec95e2c7
commit f6ddf48882
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
9 changed files with 113 additions and 260 deletions

View file

@ -4,7 +4,9 @@
#include "util.hh"
#include "eval.hh"
#include "fetchers/registry.hh"
#include "fetchers/fetchers.hh"
#include "flake/flakeref.hh"
#include "store-api.hh"
namespace nix {
@ -68,9 +70,9 @@ Bindings * MixEvalArgs::getAutoArgs(EvalState & state)
Path lookupFileArg(EvalState & state, string s)
{
if (isUri(s)) {
CachedDownloadRequest request(s);
request.unpack = true;
return getDownloader()->downloadCached(state.store, request).path;
return state.store->toRealPath(
fetchers::downloadTarball(
state.store, resolveUri(s), "source", false).storePath);
} else if (s.size() > 2 && s.at(0) == '<' && s.at(s.size() - 1) == '>') {
Path p = s.substr(1, s.size() - 2);
return state.findFile(p);