mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 16:59:35 +01:00
Make the derivation check more lazy
This commit is contained in:
parent
2324ee4891
commit
3a9753132e
1 changed files with 5 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "shared.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "value.hh"
|
||||
|
||||
#include <regex>
|
||||
#include <fstream>
|
||||
|
|
@ -100,7 +101,10 @@ struct CmdSearch : InstallableCommand, MixJSON
|
|||
};
|
||||
|
||||
try {
|
||||
if (state->isDerivation(current)) {
|
||||
auto maybeTypeField = state->lazyGetAttrField(current, {state->sType}, noPos, *vTmp);
|
||||
if (maybeTypeField == EvalState::LazyValueType::PlainValue
|
||||
&& vTmp->type() == nix::nString
|
||||
&& strcmp(vTmp->string.s, "derivation") == 0) {
|
||||
size_t found = 0;
|
||||
|
||||
state->getAttrFieldThrow(current, {state->sName}, noPos, *vTmp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue