forked from lix-project/hydra
This commit is contained in:
parent
3e192cbb90
commit
6bcdfc8a1f
|
@ -2,4 +2,4 @@ NIX = /home/eelco/Dev/nix/inst
|
||||||
ATERM = /home/eelco/Dev/nix/externals/inst-aterm
|
ATERM = /home/eelco/Dev/nix/externals/inst-aterm
|
||||||
|
|
||||||
hydra_eval_jobs: hydra_eval_jobs.cc
|
hydra_eval_jobs: hydra_eval_jobs.cc
|
||||||
libtool --mode=link g++ -o hydra_eval_jobs hydra_eval_jobs.cc -I$(NIX)/include/nix -I$(ATERM)/include -L$(NIX)/lib/nix/ -lmain -lexpr -L$(ATERM)/lib -lATerm
|
libtool --mode=link g++ -o hydra_eval_jobs hydra_eval_jobs.cc -I$(NIX)/include/nix -I$(ATERM)/include -L$(NIX)/lib/nix/ -lmain -lexpr -L$(ATERM)/lib -lATerm -Wall
|
||||||
|
|
|
@ -44,7 +44,7 @@ static void tryJobAlts(EvalState & state, XMLWriter & doc,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expr name, def; ATerm def2; ATermList values;
|
Expr name; ATerm def2; ATermList values;
|
||||||
if (!matchFormal(ATgetFirst(formals), name, def2)) abort();
|
if (!matchFormal(ATgetFirst(formals), name, def2)) abort();
|
||||||
|
|
||||||
if ((values = (ATermList) argsLeft.get(name))) {
|
if ((values = (ATermList) argsLeft.get(name))) {
|
||||||
|
@ -78,6 +78,26 @@ static void showArgsUsed(XMLWriter & doc, const ATermMap & argsUsed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static string queryMetaFieldString(MetaInfo & meta, const string & name)
|
||||||
|
{
|
||||||
|
MetaValue value = meta[name];
|
||||||
|
if (value.type != MetaValue::tpString) return "";
|
||||||
|
return value.stringValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int queryMetaFieldInt(MetaInfo & meta, const string & name, int def)
|
||||||
|
{
|
||||||
|
MetaValue value = meta[name];
|
||||||
|
if (value.type == MetaValue::tpInt) return value.intValue;
|
||||||
|
if (value.type == MetaValue::tpString) {
|
||||||
|
int n;
|
||||||
|
if (string2Int(value.stringValue, n)) return n;
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void findJobsWrapped(EvalState & state, XMLWriter & doc,
|
static void findJobsWrapped(EvalState & state, XMLWriter & doc,
|
||||||
const ATermMap & argsUsed, const ATermMap & argsLeft,
|
const ATermMap & argsUsed, const ATermMap & argsLeft,
|
||||||
Expr e, const string & attrPath)
|
Expr e, const string & attrPath)
|
||||||
|
@ -86,7 +106,7 @@ static void findJobsWrapped(EvalState & state, XMLWriter & doc,
|
||||||
|
|
||||||
e = evalExpr(state, e);
|
e = evalExpr(state, e);
|
||||||
|
|
||||||
ATermList as, es, formals;
|
ATermList as, formals;
|
||||||
ATermBool ellipsis;
|
ATermBool ellipsis;
|
||||||
ATerm pat, body, pos;
|
ATerm pat, body, pos;
|
||||||
string s;
|
string s;
|
||||||
|
@ -107,11 +127,13 @@ static void findJobsWrapped(EvalState & state, XMLWriter & doc,
|
||||||
xmlAttrs["system"] = drv.system;
|
xmlAttrs["system"] = drv.system;
|
||||||
xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath(state);
|
xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath(state);
|
||||||
xmlAttrs["outPath"] = drv.queryOutPath(state);
|
xmlAttrs["outPath"] = drv.queryOutPath(state);
|
||||||
xmlAttrs["description"] = drv.queryMetaInfo(state, "description");
|
MetaInfo meta = drv.queryMetaInfo(state);
|
||||||
xmlAttrs["longDescription"] = drv.queryMetaInfo(state, "longDescription");
|
xmlAttrs["description"] = queryMetaFieldString(meta, "description");
|
||||||
xmlAttrs["license"] = drv.queryMetaInfo(state, "license");
|
xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
|
||||||
xmlAttrs["homepage"] = drv.queryMetaInfo(state, "homepage");
|
xmlAttrs["license"] = queryMetaFieldString(meta, "license");
|
||||||
xmlAttrs["schedulingPriority"] = drv.queryMetaInfo(state, "schedulingPriority");
|
xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
|
||||||
|
int prio = queryMetaFieldInt(meta, "schedulingPriority", 100);
|
||||||
|
xmlAttrs["schedulingPriority"] = int2String(prio);
|
||||||
|
|
||||||
/* Register the derivation as a GC root. !!! This
|
/* Register the derivation as a GC root. !!! This
|
||||||
registers roots for jobs that we may have already
|
registers roots for jobs that we may have already
|
||||||
|
|
Loading…
Reference in a new issue