From a5d820a0a396db01e6297dfcadaa3218a1e918c7 Mon Sep 17 00:00:00 2001 From: Carlo Nucera Date: Tue, 2 Jun 2020 11:00:10 -0400 Subject: [PATCH] Change parseCa(Opt) to parseContentAddress(Opt) --- src/libstore/daemon.cc | 2 +- src/libstore/file-hash.cc | 6 +++--- src/libstore/file-hash.hh | 4 ++-- src/libstore/legacy-ssh-store.cc | 2 +- src/libstore/local-store.cc | 2 +- src/libstore/nar-info-disk-cache.cc | 2 +- src/libstore/nar-info.cc | 2 +- src/libstore/remote-store.cc | 2 +- src/nix-store/nix-store.cc | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 45bfa6753..0734f990a 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -711,7 +711,7 @@ static void performOp(TunnelLogger * logger, ref store, { string caOptRaw; from >> caOptRaw; - info.ca = parseCaOpt(caOptRaw); + info.ca = parseContentAddressOpt(caOptRaw); } from >> repair >> dontCheckSigs; if (!trusted && dontCheckSigs) diff --git a/src/libstore/file-hash.cc b/src/libstore/file-hash.cc index 494079c18..26153a424 100644 --- a/src/libstore/file-hash.cc +++ b/src/libstore/file-hash.cc @@ -38,12 +38,12 @@ std::string renderContentAddress(ContentAddress ca) { }, ca); } -ContentAddress parseCa(std::string_view rawCa) { +ContentAddress parseContentAddress(std::string_view rawCa) { throw Error("TODO"); }; -std::optional parseCaOpt(std::string_view rawCaOpt) { - return rawCaOpt == "" ? std::optional {} : parseCa(rawCaOpt); +std::optional parseContentAddressOpt(std::string_view rawCaOpt) { + return rawCaOpt == "" ? std::optional {} : parseContentAddress(rawCaOpt); }; std::string renderContentAddress(std::optional ca) { diff --git a/src/libstore/file-hash.hh b/src/libstore/file-hash.hh index 9d12f5fe7..64d514751 100644 --- a/src/libstore/file-hash.hh +++ b/src/libstore/file-hash.hh @@ -59,8 +59,8 @@ std::string renderContentAddress(ContentAddress ca); std::string renderContentAddress(std::optional ca); -ContentAddress parseCa(std::string_view rawCa); +ContentAddress parseContentAddress(std::string_view rawCa); -std::optional parseCaOpt(std::string_view rawCaOpt); +std::optional parseContentAddressOpt(std::string_view rawCaOpt); } diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc index 8471ed073..9b6e6e6d7 100644 --- a/src/libstore/legacy-ssh-store.cc +++ b/src/libstore/legacy-ssh-store.cc @@ -117,7 +117,7 @@ struct LegacySSHStore : public Store { std::string rawCaOpt; conn->from >> rawCaOpt; - info->ca = parseCaOpt(rawCaOpt); + info->ca = parseContentAddressOpt(rawCaOpt); } info->sigs = readStrings(conn->from); } diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index fe346f96a..2067343c7 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -662,7 +662,7 @@ void LocalStore::queryPathInfoUncached(const StorePath & path, if (s) info->sigs = tokenizeString(s, " "); s = (const char *) sqlite3_column_text(state->stmtQueryPathInfo, 7); - if (s) info->ca = parseCaOpt(s); + if (s) info->ca = parseContentAddressOpt(s); /* Get the references. */ auto useQueryReferences(state->stmtQueryReferences.use()(info->id)); diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index b4346d4d1..def514840 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -203,7 +203,7 @@ public: narInfo->deriver = StorePath::fromBaseName(queryNAR.getStr(9)); for (auto & sig : tokenizeString(queryNAR.getStr(10), " ")) narInfo->sigs.insert(sig); - narInfo->ca = parseCaOpt(queryNAR.getStr(11)); + narInfo->ca = parseContentAddressOpt(queryNAR.getStr(11)); return {oValid, narInfo}; }); diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc index 4f7c732ce..fe37d67ec 100644 --- a/src/libstore/nar-info.cc +++ b/src/libstore/nar-info.cc @@ -69,7 +69,7 @@ NarInfo::NarInfo(const Store & store, const std::string & s, const std::string & else if (name == "CA") { if (ca) corrupt(); // FIXME: allow blank ca or require skipping field? - ca = parseCaOpt(value); + ca = parseContentAddressOpt(value); } pos = eol + 1; diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 2744245f3..6dab9dc16 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -383,7 +383,7 @@ void RemoteStore::queryPathInfoUncached(const StorePath & path, info->sigs = readStrings(conn->from); string caOptRaw; conn->from >> caOptRaw; - info->ca = parseCaOpt(caOptRaw); + info->ca = parseContentAddressOpt(caOptRaw); } } callback(std::move(info)); diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 64ee9fd45..5d8d04252 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -947,7 +947,7 @@ static void opServe(Strings opFlags, Strings opArgs) { std::string rawCA; in >> rawCA; - info.ca = parseCaOpt(rawCA); + info.ca = parseContentAddressOpt(rawCA); } if (info.narSize == 0)