* Export all relevant info about the derivation.

This commit is contained in:
Eelco Dolstra 2009-03-06 15:16:29 +00:00
parent 55b8190fde
commit f9d4957f2f

View file

@ -8,6 +8,7 @@
#include "nixexpr-ast.hh"
#include "util.hh"
#include "xml-writer.hh"
#include "get-drvs.hh"
using namespace nix;
@ -40,20 +41,22 @@ static void findJobs(EvalState & state, XMLWriter & doc,
ATermMap attrs;
queryAllAttrs(e, attrs);
Expr a = evalAttr(state, attrs.get(toATerm("type")));
if (a && matchStr(a, s, context) && s == "derivation") {
DrvInfo drv;
if (getDerivation(state, e, drv)) {
std::cerr << "derivation\n";
XMLAttrs xmlAttrs;
Path outPath, drvPath;
xmlAttrs["name"] = attrPath;
a = evalAttr(state, attrs.get(toATerm("drvPath")));
if (matchStr(a, drvPath, context)) xmlAttrs["drvPath"] = drvPath;
a = evalAttr(state, attrs.get(toATerm("outPath")));
if (matchStr(a, outPath, context)) xmlAttrs["outPath"] = outPath;
xmlAttrs["system"] = drv.system;
xmlAttrs["drvPath"] = drv.queryDrvPath(state);
xmlAttrs["outPath"] = drv.queryOutPath(state);
xmlAttrs["description"] = drv.queryMetaInfo(state, "description");
xmlAttrs["longDescription"] = drv.queryMetaInfo(state, "longDescription");
xmlAttrs["license"] = drv.queryMetaInfo(state, "license");
xmlAttrs["homepage"] = drv.queryMetaInfo(state, "homepage");
XMLOpenElement _(doc, "job", xmlAttrs);
}