mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 09:19:36 +01:00
Revert the enum struct change
Not a regular git revert as there have been many merges and things.
This commit is contained in:
parent
bbbf3602a3
commit
15abb2aa2b
68 changed files with 418 additions and 457 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue