mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00:00
Remove tarball-cache.{hh,cc}
TarballInfo is only used in github.cc, and getTarballCache() is a bit too trivial to have its own file.
This commit is contained in:
parent
9b04ce16fc
commit
78b8db72b5
@ -986,4 +986,11 @@ std::vector<std::tuple<GitRepoImpl::Submodule, Hash>> GitRepoImpl::getSubmodules
|
||||
return result;
|
||||
}
|
||||
|
||||
ref<GitRepo> getTarballCache()
|
||||
{
|
||||
static auto repoDir = std::filesystem::path(getCacheDir()) / "nix" / "tarball-cache";
|
||||
|
||||
return GitRepo::openRepo(repoDir, true, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -95,4 +95,6 @@ struct GitRepo
|
||||
const std::vector<fetchers::PublicKey> & publicKeys) = 0;
|
||||
};
|
||||
|
||||
ref<GitRepo> getTarballCache();
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "tarball.hh"
|
||||
#include "tarfile.hh"
|
||||
#include "git-utils.hh"
|
||||
#include "tarball-cache.hh"
|
||||
|
||||
#include <optional>
|
||||
#include <nlohmann/json.hpp>
|
||||
@ -193,6 +192,12 @@ struct GitArchiveInputScheme : InputScheme
|
||||
|
||||
virtual DownloadUrl getDownloadUrl(const Input & input) const = 0;
|
||||
|
||||
struct TarballInfo
|
||||
{
|
||||
Hash treeHash;
|
||||
time_t lastModified;
|
||||
};
|
||||
|
||||
std::pair<Input, TarballInfo> downloadArchive(ref<Store> store, Input input) const
|
||||
{
|
||||
if (!maybeGetStrAttr(input.attrs, "ref")) input.attrs.insert_or_assign("ref", "HEAD");
|
||||
|
@ -1,13 +0,0 @@
|
||||
#include "tarball-cache.hh"
|
||||
#include "users.hh"
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
||||
ref<GitRepo> getTarballCache()
|
||||
{
|
||||
static auto repoDir = std::filesystem::path(getCacheDir()) / "nix" / "tarball-cache";
|
||||
|
||||
return GitRepo::openRepo(repoDir, true, true);
|
||||
}
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "ref.hh"
|
||||
#include "git-utils.hh"
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
||||
struct TarballInfo
|
||||
{
|
||||
Hash treeHash;
|
||||
time_t lastModified;
|
||||
};
|
||||
|
||||
ref<GitRepo> getTarballCache();
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user