diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-11-25T13·00+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-11-25T13·00+0100 |
commit | afef347157e618acb1f6e10b3d92ab897991cf2a (patch) | |
tree | 81d44ed0323962809c2a2b57ad31bb8d4187e3e6 /src | |
parent | 4c1c7e58128f921587589b1d56486a809df490c4 (diff) | |
parent | 4921223160ebde522b8362c46e8f962fc09878ac (diff) |
Merge pull request #712 from pSub/print-meta-license
Print license information on '--xml --meta'
Diffstat (limited to 'src')
-rw-r--r-- | src/nix-env/nix-env.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 313f8a8a8f35..02a9f25a7a4e 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -1140,7 +1140,19 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) attrs3["value"] = v->listElems()[j]->string.s; xml.writeEmptyElement("string", attrs3); } + } else if (v->type == tAttrs) { + attrs2["type"] = "strings"; + XMLOpenElement m(xml, "meta", attrs2); + Bindings & attrs = *v->attrs; + for (auto &i : attrs) { + Attr & a(*attrs.find(i.name)); + if(a.value->type != tString) continue; + XMLAttrs attrs3; + attrs3["type"] = i.name; + attrs3["value"] = a.value->string.s; + xml.writeEmptyElement("string", attrs3); } + } } } } |