Move download stuff into tarball.hh

This commit is contained in:
Eelco Dolstra 2022-08-01 16:05:58 +02:00
parent 48012603b3
commit 71b155b9e6
10 changed files with 38 additions and 25 deletions

View file

@ -9,6 +9,7 @@
#include "store-api.hh"
#include "command.hh"
#include "fs-input-accessor.hh"
#include "tarball.hh"
namespace nix {

View file

@ -640,6 +640,7 @@ formal
#include "filetransfer.hh"
#include "fetchers.hh"
#include "fs-input-accessor.hh"
#include "tarball.hh"
#include "store-api.hh"

View file

@ -4,6 +4,7 @@
#include "fetchers.hh"
#include "filetransfer.hh"
#include "registry.hh"
#include "tarball.hh"
#include <ctime>
#include <iomanip>

View file

@ -1,6 +1,7 @@
#pragma once
#include "fetchers.hh"
#include "path.hh"
namespace nix::fetchers {

View file

@ -2,14 +2,13 @@
#include "types.hh"
#include "hash.hh"
#include "path.hh"
#include "canon-path.hh"
#include "attrs.hh"
#include "url.hh"
#include <memory>
namespace nix { class Store; class InputAccessor; }
namespace nix { class Store; class StorePath; class InputAccessor; }
namespace nix::fetchers {
@ -148,25 +147,4 @@ struct InputScheme
void registerInputScheme(std::shared_ptr<InputScheme> && fetcher);
struct DownloadFileResult
{
StorePath storePath;
std::string etag;
std::string effectiveUrl;
};
DownloadFileResult downloadFile(
ref<Store> store,
const std::string & url,
const std::string & name,
bool locked,
const Headers & headers = {});
std::pair<StorePath, time_t> downloadTarball(
ref<Store> store,
const std::string & url,
const std::string & name,
bool locked,
const Headers & headers = {});
}

View file

@ -8,6 +8,7 @@
#include "fetchers.hh"
#include "fetch-settings.hh"
#include "input-accessor.hh"
#include "tarball.hh"
#include <optional>
#include <nlohmann/json.hpp>

View file

@ -1,5 +1,5 @@
#include "registry.hh"
#include "fetchers.hh"
#include "tarball.hh"
#include "util.hh"
#include "globals.hh"
#include "store-api.hh"

View file

@ -1,3 +1,4 @@
#include "tarball.hh"
#include "fetchers.hh"
#include "cache.hh"
#include "filetransfer.hh"

View file

@ -0,0 +1,29 @@
#pragma once
#include "types.hh"
#include "path.hh"
namespace nix::fetchers {
struct DownloadFileResult
{
StorePath storePath;
std::string etag;
std::string effectiveUrl;
};
DownloadFileResult downloadFile(
ref<Store> store,
const std::string & url,
const std::string & name,
bool locked,
const Headers & headers = {});
std::pair<StorePath, time_t> downloadTarball(
ref<Store> store,
const std::string & url,
const std::string & name,
bool locked,
const Headers & headers = {});
}

View file

@ -3,7 +3,7 @@
#include "filetransfer.hh"
#include "store-api.hh"
#include "legacy.hh"
#include "fetchers.hh"
#include "tarball.hh"
#include <fcntl.h>
#include <regex>