diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 22:09:22 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 22:11:26 +0000 |
commit | 15abb2aa2ba7de06a86e05511f81633616e17d87 (patch) | |
tree | 077cb0b6fe627e04aee10c93ed45f402996ebe70 /src/libfetchers/tarball.cc | |
parent | bbbf3602a323538b8da38f1a2c7ce136a20f74c6 (diff) |
Revert the `enum struct` change
Not a regular git revert as there have been many merges and things.
Diffstat (limited to 'src/libfetchers/tarball.cc')
-rw-r--r-- | src/libfetchers/tarball.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index c82b6dd09..ac83d52b9 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -66,9 +66,9 @@ DownloadFileResult downloadFile( } else { StringSink sink; dumpString(*res.data, sink); - auto hash = hashString(HashType::SHA256, *res.data); + auto hash = hashString(htSHA256, *res.data); ValidPathInfo info(store->makeFixedOutputPath(FileIngestionMethod::Flat, hash, name)); - info.narHash = hashString(HashType::SHA256, *sink.s); + info.narHash = hashString(htSHA256, *sink.s); info.narSize = sink.s->size(); info.ca = makeFixedOutputCA(FileIngestionMethod::Flat, hash); auto source = StringSource { *sink.s }; @@ -142,7 +142,7 @@ Tree downloadTarball( throw nix::Error("tarball '%s' contains an unexpected number of top-level files", url); auto topDir = tmpDir + "/" + members.begin()->name; lastModified = lstat(topDir).st_mtime; - unpackedStorePath = store->addToStore(name, topDir, FileIngestionMethod::Recursive, HashType::SHA256, defaultPathFilter, NoRepair); + unpackedStorePath = store->addToStore(name, topDir, FileIngestionMethod::Recursive, htSHA256, defaultPathFilter, NoRepair); } Attrs infoAttrs({ @@ -196,9 +196,9 @@ struct TarballInput : Input // NAR hashes are preferred over file hashes since tar/zip files // don't have a canonical representation. if (narHash) - url2.query.insert_or_assign("narHash", narHash->to_string(Base::SRI, true)); + url2.query.insert_or_assign("narHash", narHash->to_string(SRI, true)); else if (hash) - url2.query.insert_or_assign("hash", hash->to_string(Base::SRI, true)); + url2.query.insert_or_assign("hash", hash->to_string(SRI, true)); return url2; } @@ -207,7 +207,7 @@ struct TarballInput : Input Attrs attrs; attrs.emplace("url", url.to_string()); if (hash) - attrs.emplace("hash", hash->to_string(Base::SRI, true)); + attrs.emplace("hash", hash->to_string(SRI, true)); return attrs; } |