diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 15:18:19 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 15:26:59 +0000 |
commit | 2f0e395c99f926b9f0a65e37ea644a40ec5dddfa (patch) | |
tree | f9d8d6e0ae6e4b945f296484358d84e889a2ef11 /src/libstore/content-address.cc | |
parent | 3fc58a96387f55226ad78a0d8e765a0f041e8da0 (diff) | |
parent | fb39a5e00c03c8fb3b893263e1d2b151c3ba11aa (diff) |
Merge remote-tracking branch 'me/no-stringly-typed-derivation-output' into validPathInfo-ca-proper-datatype
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r-- | src/libstore/content-address.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc index 7de5c0874..98b3677bb 100644 --- a/src/libstore/content-address.cc +++ b/src/libstore/content-address.cc @@ -2,7 +2,7 @@ namespace nix { -std::string FileSystemHash::printMethodAlgo() const { +std::string FixedOutputHash::printMethodAlgo() const { return makeFileIngestionPrefix(method) + printHashType(*hash.type); } @@ -33,7 +33,7 @@ std::string renderContentAddress(ContentAddress ca) { [](TextHash th) { return "text:" + th.hash.to_string(Base32, true); }, - [](FileSystemHash fsh) { + [](FixedOutputHash fsh) { return makeFixedOutputCA(fsh.method, fsh.hash); } }, ca); @@ -55,10 +55,10 @@ ContentAddress parseContentAddress(std::string_view rawCa) { auto methodAndHash = rawCa.substr(prefixSeparator+1, string::npos); if (methodAndHash.substr(0,2) == "r:") { std::string_view hashRaw = methodAndHash.substr(2,string::npos); - return FileSystemHash { FileIngestionMethod::Recursive, Hash(string(hashRaw)) }; + return FixedOutputHash { FileIngestionMethod::Recursive, Hash(string(hashRaw)) }; } else { std::string_view hashRaw = methodAndHash; - return FileSystemHash { FileIngestionMethod::Flat, Hash(string(hashRaw)) }; + return FixedOutputHash { FileIngestionMethod::Flat, Hash(string(hashRaw)) }; } } else { throw Error("parseContentAddress: format not recognized; has to be text or fixed"); |