[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/376: nix-env -qa --json: Generate valid JSON even if there are invali
From: |
Ludovic Courtès |
Subject: |
17/376: nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs |
Date: |
Wed, 28 Jan 2015 22:03:45 +0000 |
civodul pushed a commit to tag 1.8
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);
}
- 06/376: Add primop ‘scopedImport’, (continued)
- 06/376: Add primop ‘scopedImport’, Ludovic Courtès, 2015/01/28
- 08/376: Ensure that -I flags get included in nixPath, Ludovic Courtès, 2015/01/28
- 11/376: Rephrase @ operator description, Ludovic Courtès, 2015/01/28
- 12/376: dev-shell is a bash script, not sh, Ludovic Courtès, 2015/01/28
- 09/376: Make the Nix search path declarative, Ludovic Courtès, 2015/01/28
- 03/376: Disable parallel.sh test, Ludovic Courtès, 2015/01/28
- 10/376: Remove ExprBuiltin, Ludovic Courtès, 2015/01/28
- 02/376: nix-store -l: Fetch build logs from the Internet, Ludovic Courtès, 2015/01/28
- 13/376: nix-build: --add-root also takes 1 parameter, Ludovic Courtès, 2015/01/28
- 07/376: Add constant ‘nixPath’, Ludovic Courtès, 2015/01/28
- 17/376: nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs,
Ludovic Courtès <=
- 14/376: Use std::unordered_set, Ludovic Courtès, 2015/01/28
- 15/376: Sort nixPath attributes, Ludovic Courtès, 2015/01/28
- 16/376: Fix test, Ludovic Courtès, 2015/01/28
- 21/376: Add autoloads, make code more concise & idiomatic, Ludovic Courtès, 2015/01/28
- 18/376: Print a warning when loading a large path into memory, Ludovic Courtès, 2015/01/28
- 19/376: Report daemon OOM better, Ludovic Courtès, 2015/01/28
- 22/376: Share code between scopedImport and import, Ludovic Courtès, 2015/01/28
- 28/376: Only add the importNative primop if the allow-arbitrary-code-during-evaluation option is true (default false), Ludovic Courtès, 2015/01/28
- 26/376: Don't use member initialisers, Ludovic Courtès, 2015/01/28
- 27/376: Add importNative primop, Ludovic Courtès, 2015/01/28