diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-03-25 16:46:28 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-03-25 16:48:50 +0000 |
commit | 0966532dc15485f24080e868f0c0553b5dc762c9 (patch) | |
tree | 4c3b0f31331b0588133bbbd0083adc85450fcc46 /src/libcmd | |
parent | e5c42bba9bf76d00fb15ec9a179bf91aa81c38c6 (diff) | |
parent | 1844172dd16cab611a0148be9381ab856bf241df (diff) |
Merge remote-tracking branch 'upstream' into indexed-store-path-outputs
Co-Authored-By: Tom Bereknyei <tomberek@gmail.com>
Diffstat (limited to 'src/libcmd')
-rw-r--r-- | src/libcmd/command.cc | 3 | ||||
-rw-r--r-- | src/libcmd/installables.cc | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index dc8fa9e5a..a53b029b7 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -204,7 +204,8 @@ Strings editorFor(const Pos & pos) if (pos.line > 0 && ( editor.find("emacs") != std::string::npos || editor.find("nano") != std::string::npos || - editor.find("vim") != std::string::npos)) + editor.find("vim") != std::string::npos || + editor.find("kak") != std::string::npos)) args.push_back(fmt("+%d", pos.line)); args.push_back(pos.file); return args; diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 1469642ff..a9923331e 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -134,7 +134,9 @@ SourceExprCommand::SourceExprCommand() addFlag({ .longName = "file", .shortName = 'f', - .description = "Interpret installables as attribute paths relative to the Nix expression stored in *file*.", + .description = + "Interpret installables as attribute paths relative to the Nix expression stored in *file*. " + "If *file* is the character -, then a Nix expression will be read from standard input.", .category = installablesCategory, .labels = {"file"}, .handler = {&file}, @@ -715,7 +717,10 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( auto state = getEvalState(); auto vFile = state->allocValue(); - if (file) + if (file == "-") { + auto e = state->parseStdin(); + state->eval(e, *vFile); + } else if (file) state->evalFile(lookupFileArg(*state, *file), *vFile); else { auto e = state->parseExprFromString(*expr, absPath(".")); @@ -862,11 +867,8 @@ BuiltPaths Installable::build( std::visit(overloaded { [&](const DerivedPath::Built & bfd) { std::map<std::string, StorePath> outputs; - for (auto & path : buildResult.builtOutputs) { - // Don't report unrequested outputs - if (!wantOutput(path.first.outputName, bfd.outputs)) continue; + for (auto & path : buildResult.builtOutputs) outputs.emplace(path.first.outputName, path.second.outPath); - } res.push_back(BuiltPath::Built { bfd.drvPath, outputs }); }, [&](const DerivedPath::Opaque & bo) { |