1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Make the store directory a member variable of Store

This commit is contained in:
Eelco Dolstra 2016-06-01 14:49:12 +02:00
parent 1b5b654fe2
commit 7850d3d279
35 changed files with 315 additions and 296 deletions

View file

@ -13,7 +13,7 @@ private:
public:
LocalBinaryCacheStore(
const StoreParams & params, const Path & binaryCacheDir)
const Params & params, const Path & binaryCacheDir)
: BinaryCacheStore(params)
, binaryCacheDir(binaryCacheDir)
{
@ -45,7 +45,7 @@ protected:
if (entry.name.size() != 40 ||
!hasSuffix(entry.name, ".narinfo"))
continue;
paths.insert(settings.nixStore + "/" + entry.name.substr(0, entry.name.size() - 8));
paths.insert(storeDir + "/" + entry.name.substr(0, entry.name.size() - 8));
}
return paths;
@ -59,7 +59,7 @@ void LocalBinaryCacheStore::init()
BinaryCacheStore::init();
if (diskCache && !diskCache->cacheExists(getUri()))
diskCache->createCache(getUri(), wantMassQuery_, priority);
diskCache->createCache(getUri(), storeDir, wantMassQuery_, priority);
}
static void atomicWrite(const Path & path, const std::string & s)
@ -93,7 +93,7 @@ std::shared_ptr<std::string> LocalBinaryCacheStore::getFile(const std::string &
}
static RegisterStoreImplementation regStore([](
const std::string & uri, const StoreParams & params)
const std::string & uri, const Store::Params & params)
-> std::shared_ptr<Store>
{
if (std::string(uri, 0, 7) != "file://") return 0;