diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-04-24 13:20:36 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-04-24 13:20:36 +0200 |
commit | 01232358ffd78600d170ca5c1526a7031f6f2762 (patch) | |
tree | babf00196894ec8b79fb963419fe4a6d44e56db4 /src/libfetchers | |
parent | cb2615cf4735cf28a6e538544c9abbf40cdd24a9 (diff) | |
parent | 7474a90db69813d051ab1bef35c7d0ab958d9ccd (diff) |
Merge remote-tracking branch 'origin/master' into source-path
Diffstat (limited to 'src/libfetchers')
-rw-r--r-- | src/libfetchers/fetchers.cc | 8 | ||||
-rw-r--r-- | src/libfetchers/tarball.cc | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index c767e72e5..91db3a9eb 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -210,7 +210,13 @@ StorePath Input::computeStorePath(Store & store) const auto narHash = getNarHash(); if (!narHash) throw Error("cannot compute store path for unlocked input '%s'", to_string()); - return store.makeFixedOutputPath(FileIngestionMethod::Recursive, *narHash, getName()); + return store.makeFixedOutputPath(getName(), FixedOutputInfo { + .hash = { + .method = FileIngestionMethod::Recursive, + .hash = *narHash, + }, + .references = {}, + }); } std::string Input::getType() const diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index e9686262a..96fe5faca 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -71,15 +71,19 @@ DownloadFileResult downloadFile( dumpString(res.data, sink); auto hash = hashString(htSHA256, res.data); ValidPathInfo info { - store->makeFixedOutputPath(FileIngestionMethod::Flat, hash, name), + *store, + name, + FixedOutputInfo { + .hash = { + .method = FileIngestionMethod::Flat, + .hash = hash, + }, + .references = {}, + }, hashString(htSHA256, sink.s), }; info.narSize = sink.s.size(); - info.ca = FixedOutputHash { - .method = FileIngestionMethod::Flat, - .hash = hash, - }; - auto source = StringSource(sink.s); + auto source = StringSource { sink.s }; store->addToStore(info, source, NoRepair, NoCheckSigs); storePath = std::move(info.path); } |