diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 14:47:10 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 14:47:10 +0000 |
commit | 237d88c97e1f08f8c1513261ac5fea847d5917ff (patch) | |
tree | 52b3e111b17395b5de1247ed4c37e093f85b48f2 /src/libstore | |
parent | 517f5980e2c63af47e7042873cc33b521918ad35 (diff) |
FileSystemHash -> DerivationOutputHash
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/derivations.cc | 10 | ||||
-rw-r--r-- | src/libstore/derivations.hh | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 826b336e0..51a01feac 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -8,7 +8,7 @@ namespace nix { -std::string FileSystemHash::printMethodAlgo() const { +std::string DerivationOutputHash::printMethodAlgo() const { return makeFileIngestionPrefix(method) + printHashType(hash.type); } @@ -113,7 +113,7 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream expect(str, ","); const auto hash = parseString(str); expect(str, ")"); - std::optional<FileSystemHash> fsh; + std::optional<DerivationOutputHash> fsh; if (hashAlgo != "") { auto method = FileIngestionMethod::Flat; if (string(hashAlgo, 0, 2) == "r:") { @@ -123,7 +123,7 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream const HashType hashType = parseHashType(hashAlgo); if (hashType == htUnknown) throw Error("unknown hash hashAlgorithm '%s'", hashAlgo); - fsh = FileSystemHash { + fsh = DerivationOutputHash { std::move(method), Hash(hash, hashType), }; @@ -413,7 +413,7 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store) auto hashAlgo = readString(in); const auto hash = readString(in); - std::optional<FileSystemHash> fsh; + std::optional<DerivationOutputHash> fsh; if (hashAlgo != "") { auto method = FileIngestionMethod::Flat; if (string(hashAlgo, 0, 2) == "r:") { @@ -423,7 +423,7 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store) const HashType hashType = parseHashType(hashAlgo); if (hashType == htUnknown) throw Error("unknown hash hashAlgorithm '%s'", hashAlgo); - fsh = FileSystemHash { + fsh = DerivationOutputHash { std::move(method), Hash(hash, hashType), }; diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index 3b4eb7ec4..f3eff2748 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -13,23 +13,23 @@ namespace nix { /* Abstract syntax of derivations. */ /// Pair of a hash, and how the file system was ingested -struct FileSystemHash { +struct DerivationOutputHash { FileIngestionMethod method; Hash hash; - FileSystemHash(FileIngestionMethod method, Hash hash) + DerivationOutputHash(FileIngestionMethod method, Hash hash) : method(std::move(method)) , hash(std::move(hash)) { } - FileSystemHash(const FileSystemHash &) = default; - FileSystemHash(FileSystemHash &&) = default; - FileSystemHash & operator = (const FileSystemHash &) = default; + DerivationOutputHash(const DerivationOutputHash &) = default; + DerivationOutputHash(DerivationOutputHash &&) = default; + DerivationOutputHash & operator = (const DerivationOutputHash &) = default; std::string printMethodAlgo() const; }; struct DerivationOutput { StorePath path; - std::optional<FileSystemHash> hash; /* hash used for expected hash computation */ + std::optional<DerivationOutputHash> hash; /* hash used for expected hash computation */ void parseHashInfo(FileIngestionMethod & recursive, Hash & hash) const; }; |