aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/tarball.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-03 16:15:22 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-03 16:15:22 +0200
commitc20591ddc3454263ac49435624f4ec2983ee335d (patch)
treee026dc0c272e02b3e5293f819b46f8f93df3d206 /src/libfetchers/tarball.cc
parent7dbba0a94e3d5ad0388131d5653808084c42db89 (diff)
parent01572c2198de49071827f0be9f5db202bac21703 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libfetchers/tarball.cc')
-rw-r--r--src/libfetchers/tarball.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc
index 9479bb1b3..b4b7725a0 100644
--- a/src/libfetchers/tarball.cc
+++ b/src/libfetchers/tarball.cc
@@ -67,11 +67,12 @@ DownloadFileResult downloadFile(
StringSink sink;
dumpString(*res.data, sink);
auto hash = hashString(htSHA256, *res.data);
- ValidPathInfo info(store->makeFixedOutputPath(false, hash, name));
+ ValidPathInfo info(store->makeFixedOutputPath(FileIngestionMethod::Flat, hash, name));
info.narHash = hashString(htSHA256, *sink.s);
info.narSize = sink.s->size();
- info.ca = makeFixedOutputCA(false, hash);
- store->addToStore(info, sink.s, NoRepair, NoCheckSigs);
+ info.ca = makeFixedOutputCA(FileIngestionMethod::Flat, hash);
+ auto source = StringSource { *sink.s };
+ store->addToStore(info, source, NoRepair, NoCheckSigs);
storePath = std::move(info.path);
}
@@ -138,7 +139,7 @@ std::pair<Tree, time_t> 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, true, htSHA256, defaultPathFilter, NoRepair);
+ unpackedStorePath = store->addToStore(name, topDir, FileIngestionMethod::Recursive, htSHA256, defaultPathFilter, NoRepair);
}
Attrs infoAttrs({