From a992f688d1dac8a12e1cc83babe4c511dafa792f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Feb 2016 12:51:10 +0100 Subject: [PATCH] Rename class --- src/hydra-queue-runner/binary-cache-store.cc | 24 ++++++++++---------- src/hydra-queue-runner/binary-cache-store.hh | 4 ++-- src/hydra-queue-runner/hydra-queue-runner.cc | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/hydra-queue-runner/binary-cache-store.cc b/src/hydra-queue-runner/binary-cache-store.cc index e73cd00d..4fe11007 100644 --- a/src/hydra-queue-runner/binary-cache-store.cc +++ b/src/hydra-queue-runner/binary-cache-store.cc @@ -9,7 +9,7 @@ namespace nix { -LocalBinaryCache::LocalBinaryCache(ref localStore, const Path & binaryCacheDir, +BinaryCacheStore::BinaryCacheStore(ref localStore, const Path & binaryCacheDir, const Path & secretKeyFile, const Path & publicKeyFile) : localStore(localStore) , binaryCacheDir(binaryCacheDir) @@ -30,7 +30,7 @@ LocalBinaryCache::LocalBinaryCache(ref localStore, const Path & binaryCac } } -Path LocalBinaryCache::narInfoFileFor(const Path & storePath) +Path BinaryCacheStore::narInfoFileFor(const Path & storePath) { assertStorePath(storePath); return binaryCacheDir + "/" + storePathToHash(storePath) + ".narinfo"; @@ -46,7 +46,7 @@ void atomicWrite(const Path & path, const std::string & s) del.cancel(); } -void LocalBinaryCache::addToCache(const ValidPathInfo & info, +void BinaryCacheStore::addToCache(const ValidPathInfo & info, const string & nar) { Path narInfoFile = narInfoFileFor(info.path); @@ -80,7 +80,7 @@ void LocalBinaryCache::addToCache(const ValidPathInfo & info, atomicWrite(narInfoFile, narInfo.to_string()); } -NarInfo LocalBinaryCache::readNarInfo(const Path & storePath) +NarInfo BinaryCacheStore::readNarInfo(const Path & storePath) { Path narInfoFile = narInfoFileFor(storePath); NarInfo narInfo = NarInfo(readFile(narInfoFile), narInfoFile); @@ -94,12 +94,12 @@ NarInfo LocalBinaryCache::readNarInfo(const Path & storePath) return narInfo; } -bool LocalBinaryCache::isValidPath(const Path & storePath) +bool BinaryCacheStore::isValidPath(const Path & storePath) { return pathExists(narInfoFileFor(storePath)); } -void LocalBinaryCache::exportPath(const Path & storePath, bool sign, Sink & sink) +void BinaryCacheStore::exportPath(const Path & storePath, bool sign, Sink & sink) { assert(!sign); @@ -127,7 +127,7 @@ void LocalBinaryCache::exportPath(const Path & storePath, bool sign, Sink & sink sink << exportMagic << storePath << res.references << res.deriver << 0; } -Paths LocalBinaryCache::importPaths(bool requireSignature, Source & source) +Paths BinaryCacheStore::importPaths(bool requireSignature, Source & source) { assert(!requireSignature); Paths res; @@ -159,7 +159,7 @@ struct NopSink : ParseSink { }; -Path LocalBinaryCache::importPath(Source & source) +Path BinaryCacheStore::importPath(Source & source) { /* FIXME: some cut&paste of LocalStore::importPath(). */ @@ -187,12 +187,12 @@ Path LocalBinaryCache::importPath(Source & source) return info.path; } -ValidPathInfo LocalBinaryCache::queryPathInfo(const Path & storePath) +ValidPathInfo BinaryCacheStore::queryPathInfo(const Path & storePath) { return ValidPathInfo(readNarInfo(storePath)); } -void LocalBinaryCache::querySubstitutablePathInfos(const PathSet & paths, +void BinaryCacheStore::querySubstitutablePathInfos(const PathSet & paths, SubstitutablePathInfos & infos) { PathSet left; @@ -213,7 +213,7 @@ void LocalBinaryCache::querySubstitutablePathInfos(const PathSet & paths, localStore->querySubstitutablePathInfos(left, infos); } -void LocalBinaryCache::buildPaths(const PathSet & paths, BuildMode buildMode) +void BinaryCacheStore::buildPaths(const PathSet & paths, BuildMode buildMode) { for (auto & storePath : paths) { assert(!isDerivation(storePath)); @@ -238,7 +238,7 @@ void LocalBinaryCache::buildPaths(const PathSet & paths, BuildMode buildMode) } } -void LocalBinaryCache::ensurePath(const Path & path) +void BinaryCacheStore::ensurePath(const Path & path) { buildPaths({path}); } diff --git a/src/hydra-queue-runner/binary-cache-store.hh b/src/hydra-queue-runner/binary-cache-store.hh index 0436974e..ac4f2fd7 100644 --- a/src/hydra-queue-runner/binary-cache-store.hh +++ b/src/hydra-queue-runner/binary-cache-store.hh @@ -7,7 +7,7 @@ namespace nix { struct NarInfo; -class LocalBinaryCache : public nix::Store +class BinaryCacheStore : public nix::Store { private: ref localStore; @@ -18,7 +18,7 @@ private: public: - LocalBinaryCache(ref localStore, const Path & binaryCacheDir, + BinaryCacheStore(ref localStore, const Path & binaryCacheDir, const Path & secretKeyFile, const Path & publicKeyFile); private: diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index ef68e484..9034850e 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -33,7 +33,7 @@ ref State::getLocalStore() ref State::getDestStore() { - return make_ref(getLocalStore(), + return make_ref(getLocalStore(), "/tmp/binary-cache", "/home/eelco/Misc/Keys/test.nixos.org/secret", "/home/eelco/Misc/Keys/test.nixos.org/public");