forked from lix-project/lix
b525d0f20c
Committing a lock file using markFileChanged() required the input to
be writable by the caller in the local filesystem (using the path
returned by getSourcePath()). putFile() abstracts over this.
(cherry picked from commit 95d657c8b3ae4282e24628ba7426edb90c8f3942)
Change-Id: Ie081c5d9eb4e923b229191c5e23ece85145557ff
38 lines
693 B
C++
38 lines
693 B
C++
#pragma once
|
|
///@file
|
|
|
|
#include "fetchers.hh"
|
|
#include "path.hh"
|
|
|
|
namespace nix::fetchers {
|
|
|
|
struct Cache
|
|
{
|
|
virtual ~Cache() { }
|
|
|
|
virtual void add(
|
|
ref<Store> store,
|
|
const Attrs & inAttrs,
|
|
const Attrs & infoAttrs,
|
|
const StorePath & storePath,
|
|
bool locked) = 0;
|
|
|
|
virtual std::optional<std::pair<Attrs, StorePath>> lookup(
|
|
ref<Store> store,
|
|
const Attrs & inAttrs) = 0;
|
|
|
|
struct Result
|
|
{
|
|
bool expired = false;
|
|
Attrs infoAttrs;
|
|
StorePath storePath;
|
|
};
|
|
|
|
virtual std::optional<Result> lookupExpired(
|
|
ref<Store> store,
|
|
const Attrs & inAttrs) = 0;
|
|
};
|
|
|
|
ref<Cache> getCache();
|
|
|
|
}
|