-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix-env --query
: fix --json
ignoring --drv-path
#9257
Conversation
@@ -953,6 +953,11 @@ static void queryJSON(Globals & globals, std::vector<DrvInfo> & elems, bool prin | |||
} | |||
} | |||
|
|||
if (printDrvPath) { | |||
auto drvPath = i.queryDrvPath(); | |||
if (drvPath) pkgObj["drvPath"] = globals.state->store->printStorePath(*drvPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For ref this is the code used in the non-json path
if (printDrvPath) {
auto drvPath = i.queryDrvPath();
if (xmlOutput) {
if (drvPath) attrs["drvPath"] = store.printStorePath(*drvPath);
} else
columns.push_back(drvPath ? store.printStorePath(*drvPath) : "-");
}
9498193
to
28aa7e0
Compare
28aa7e0
to
2b90cff
Compare
```json { "AMB-plugins": { "drvPath": "/nix/store/l99cb7h2hy8dg005arsjbd9kx0w05d3h-AMB-plugins-0.8.1.drv", "name": "AMB-plugins-0.8.1", "outputName": "out", "outputs": { "out": null }, "pname": "AMB-plugins", "system": "x86_64-linux", "version": "0.8.1" }, "ArchiSteamFarm": { "drvPath": "/nix/store/nhplgyjj34fz6hjmnyih25gxscfh8s7b-ArchiSteamFarm-5.4.12.5.drv", "name": "ArchiSteamFarm-5.4.12.5", "outputName": "out", "outputs": { "out": null }, "pname": "ArchiSteamFarm", "system": "x86_64-linux", "version": "5.4.12.5" }, ... ```
2b90cff
to
a903f85
Compare
nix-env --query
: Respect --drv-path
with --json
nix-env --query
: fix --json
ignoring --drv-path
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-11-17-nix-team-meeting-minutes-104/35753/1 |
@fricklerhandwerk Please either approve or dismiss your review so the auto merge will work |
`nix-env --query`: fix `--json` ignoring `--drv-path` (cherry picked from commit 516e7dd) Change-Id: I84b5bccea9d0383e2e74544743b703942e7be547
Motivation
Context
Priorities
Add 👍 to pull requests you find important.