From f9d4957f2f05e5881b3ec70eece2473129c46344 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Mar 2009 15:16:29 +0000 Subject: [PATCH] * Export all relevant info about the derivation. --- src/c/eval-jobs.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/c/eval-jobs.cc b/src/c/eval-jobs.cc index 7a572e27..93183c6e 100644 --- a/src/c/eval-jobs.cc +++ b/src/c/eval-jobs.cc @@ -8,6 +8,7 @@ #include "nixexpr-ast.hh" #include "util.hh" #include "xml-writer.hh" +#include "get-drvs.hh" using namespace nix; @@ -40,21 +41,23 @@ 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; + 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"); - a = evalAttr(state, attrs.get(toATerm("outPath"))); - if (matchStr(a, outPath, context)) xmlAttrs["outPath"] = outPath; - XMLOpenElement _(doc, "job", xmlAttrs); }