diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc index ec3539327..f2e7a8799 100644 --- a/src/libcmd/common-eval-args.cc +++ b/src/libcmd/common-eval-args.cc @@ -9,6 +9,7 @@ #include "store-api.hh" #include "command.hh" #include "fs-input-accessor.hh" +#include "tarball.hh" namespace nix { diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index f098a4745..5b868a4cf 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -640,6 +640,7 @@ formal #include "filetransfer.hh" #include "fetchers.hh" #include "fs-input-accessor.hh" +#include "tarball.hh" #include "store-api.hh" diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index 34316c3a5..458acddc7 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -4,6 +4,7 @@ #include "fetchers.hh" #include "filetransfer.hh" #include "registry.hh" +#include "tarball.hh" #include #include diff --git a/src/libfetchers/cache.hh b/src/libfetchers/cache.hh index 3763ee2a6..3a81030dd 100644 --- a/src/libfetchers/cache.hh +++ b/src/libfetchers/cache.hh @@ -1,6 +1,7 @@ #pragma once #include "fetchers.hh" +#include "path.hh" namespace nix::fetchers { diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh index ee8d89d74..abf78f6d5 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/fetchers.hh @@ -2,14 +2,13 @@ #include "types.hh" #include "hash.hh" -#include "path.hh" #include "canon-path.hh" #include "attrs.hh" #include "url.hh" #include -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 && fetcher); -struct DownloadFileResult -{ - StorePath storePath; - std::string etag; - std::string effectiveUrl; -}; - -DownloadFileResult downloadFile( - ref store, - const std::string & url, - const std::string & name, - bool locked, - const Headers & headers = {}); - -std::pair downloadTarball( - ref store, - const std::string & url, - const std::string & name, - bool locked, - const Headers & headers = {}); - } diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index 230e60217..d101de433 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -8,6 +8,7 @@ #include "fetchers.hh" #include "fetch-settings.hh" #include "input-accessor.hh" +#include "tarball.hh" #include #include diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc index acd1ff866..380edfbbd 100644 --- a/src/libfetchers/registry.cc +++ b/src/libfetchers/registry.cc @@ -1,5 +1,5 @@ #include "registry.hh" -#include "fetchers.hh" +#include "tarball.hh" #include "util.hh" #include "globals.hh" #include "store-api.hh" diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index 45dab33ed..cb4772547 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -1,3 +1,4 @@ +#include "tarball.hh" #include "fetchers.hh" #include "cache.hh" #include "filetransfer.hh" diff --git a/src/libfetchers/tarball.hh b/src/libfetchers/tarball.hh new file mode 100644 index 000000000..564b6b037 --- /dev/null +++ b/src/libfetchers/tarball.hh @@ -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, + const std::string & url, + const std::string & name, + bool locked, + const Headers & headers = {}); + +std::pair downloadTarball( + ref store, + const std::string & url, + const std::string & name, + bool locked, + const Headers & headers = {}); + +} diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index cf52b03b4..dd9c5e66b 100755 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -3,7 +3,7 @@ #include "filetransfer.hh" #include "store-api.hh" #include "legacy.hh" -#include "fetchers.hh" +#include "tarball.hh" #include #include