[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/118: nix-env -qa --json: Generate valid JSON even if there are invali
From: |
Ludovic Courtès |
Subject: |
17/118: nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs |
Date: |
Tue, 19 May 2015 14:45:17 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 3c6b8a521561f5341652ffe37b869d5ab457227b
Author: Eelco Dolstra <address@hidden>
Date: Mon Jun 2 17:58:43 2014 +0200
nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs
---
src/nix-env/nix-env.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 2d38f2a..05f6aa3 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -882,9 +882,10 @@ static void queryJSON(Globals & globals, vector<DrvInfo> &
elems)
foreach (StringSet::iterator, j, metaNames) {
metaObj.attr(*j);
Value * v = i->queryMeta(*j);
- if (!v)
+ if (!v) {
printMsg(lvlError, format("derivation `%1%' has invalid meta
attribute `%2%'") % i->name % *j);
- else {
+ cout << "null";
+ } else {
PathSet context;
printValueAsJSON(globals.state, true, *v, cout, context);
}
- 16/118: Fix test, (continued)
- 16/118: Fix test, Ludovic Courtès, 2015/05/19
- 15/118: Sort nixPath attributes, Ludovic Courtès, 2015/05/19
- 10/118: Remove ExprBuiltin, Ludovic Courtès, 2015/05/19
- 09/118: Make the Nix search path declarative, Ludovic Courtès, 2015/05/19
- 04/118: Ugly hack to allow --argstr values starting with a dash, Ludovic Courtès, 2015/05/19
- 19/118: Report daemon OOM better, Ludovic Courtès, 2015/05/19
- 06/118: Add primop ‘scopedImport’, Ludovic Courtès, 2015/05/19
- 21/118: Add autoloads, make code more concise & idiomatic, Ludovic Courtès, 2015/05/19
- 25/118: Fix bogus warnings about dumping large paths, Ludovic Courtès, 2015/05/19
- 20/118: == operator: Ignore string context, Ludovic Courtès, 2015/05/19
- 17/118: nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs,
Ludovic Courtès <=
- 23/118: findFile: Realise the context of the path attributes, Ludovic Courtès, 2015/05/19
- 11/118: Rephrase @ operator description, Ludovic Courtès, 2015/05/19
- 29/118: Merge branch 'shlevy-import-native', Ludovic Courtès, 2015/05/19
- 12/118: dev-shell is a bash script, not sh, Ludovic Courtès, 2015/05/19
- 22/118: Share code between scopedImport and import, Ludovic Courtès, 2015/05/19
- 26/118: Don't use member initialisers, Ludovic Courtès, 2015/05/19
- 31/118: Add `--json` argument to `nix-instantiate`, Ludovic Courtès, 2015/05/19
- 18/118: Print a warning when loading a large path into memory, Ludovic Courtès, 2015/05/19
- 27/118: Add importNative primop, Ludovic Courtès, 2015/05/19
- 24/118: Drop ImportError and FindError, Ludovic Courtès, 2015/05/19