mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
fetchTree: Use isValidPath, add comment
This commit is contained in:
parent
ee019d0afc
commit
b6deca7c0d
1 changed files with 3 additions and 2 deletions
|
@ -239,13 +239,14 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
|
||||||
? state.store->makeFixedOutputPath(FileIngestionMethod::Recursive, *expectedHash, name, {})
|
? state.store->makeFixedOutputPath(FileIngestionMethod::Recursive, *expectedHash, name, {})
|
||||||
: state.store->makeFixedOutputPath(FileIngestionMethod::Flat, *expectedHash, name, {});
|
: state.store->makeFixedOutputPath(FileIngestionMethod::Flat, *expectedHash, name, {});
|
||||||
|
|
||||||
auto validPaths = state.store->queryValidPaths({expectedPath}, NoSubstitute);
|
if (state.store->isValidPath(expectedPath)) {
|
||||||
if (!validPaths.empty()) {
|
|
||||||
state.allowAndSetStorePathString(expectedPath, v);
|
state.allowAndSetStorePathString(expectedPath, v);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: fetching may fail, yet the path may be substitutable.
|
||||||
|
// https://github.com/NixOS/nix/issues/4313
|
||||||
auto storePath =
|
auto storePath =
|
||||||
unpack
|
unpack
|
||||||
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).first.storePath
|
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).first.storePath
|
||||||
|
|
Loading…
Reference in a new issue