From 6515b1a4954131010a7b19acf98dc010dde647d0 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Mon, 17 Jun 2024 14:41:22 -0600 Subject: [PATCH] de-inheritance CmdSearch for InstallableValueCommand Change-Id: I125c8cac05c8e924b55e4eb1060496e35ea4e941 --- src/nix/search.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nix/search.cc b/src/nix/search.cc index 97ef1375e..9f6b7a24e 100644 --- a/src/nix/search.cc +++ b/src/nix/search.cc @@ -1,4 +1,4 @@ -#include "command-installable-value.hh" +#include "command.hh" #include "globals.hh" #include "eval.hh" #include "eval-inline.hh" @@ -23,7 +23,7 @@ std::string wrap(std::string prefix, std::string s) return concatStrings(prefix, s, ANSI_NORMAL); } -struct CmdSearch : InstallableValueCommand, MixJSON +struct CmdSearch : InstallableCommand, MixJSON { std::vector res; std::vector excludeRes; @@ -62,8 +62,10 @@ struct CmdSearch : InstallableValueCommand, MixJSON }; } - void run(ref store, ref installable) override + void run(ref store, ref installable) override { + auto const installableValue = InstallableValue::require(installable); + settings.readOnlyMode = true; evalSettings.enableImportFromDerivation.setDefault(false); @@ -192,7 +194,7 @@ struct CmdSearch : InstallableValueCommand, MixJSON } }; - for (auto & cursor : installable->getCursors(*state)) + for (auto & cursor : installableValue->getCursors(*state)) visit(*cursor, cursor->getAttrPath(), true); if (json)