Handle attrsets in meta.license (i.e. lib.licenses)

[?]
Oct 8, 2015, 9:56 AM
ALU52WZJLRFVE3V7SLKBM2ENA6CO6LU2MDNUVGPTWXO7ZCXDV2WAC

Dependencies

  • [2] HNGPGVBT Fix build
  • [3] KD5237CU * eval-jobs now efficiently evaluates all Hydra jobs from a
  • [4] HVXL2XUZ
  • [5] DPYJFBXU hydra-eval-jobs: Support meta.license being a list
  • [6] 5X6FHW3S hydra-eval-jobs: Fix building against the latest unstable Nix
  • [*] 4N5APGRG * Start of a helper tool to evaluate job expressions efficiently.

Change contents

  • replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 74
    [3.296][3.87:231](),[3.231][2.161:193](),[2.193][3.268:297](),[3.268][3.268:297](),[3.297][2.194:303](),[2.303][3.406:636](),[3.406][3.406:636]()
    Value * v = drv.queryMeta(name);
    if (v) {
    state.forceValue(*v);
    if (v->type == tString)
    return v->string.s;
    else if (v->isList()) {
    string res = "";
    for (unsigned int n = 0; n < v->listSize(); ++n) {
    Value v2(*v->listElems()[n]);
    state.forceValue(v2);
    if (v2.type == tString) {
    if (res.size() != 0) res += ", ";
    res += v2.string.s;
    }
    }
    return res;
    [3.296]
    [3.386]
    Strings res;
    std::function<void(Value & v)> rec;
    rec = [&](Value & v) {
    state.forceValue(v);
    if (v.type == tString)
    res.push_back(v.string.s);
    else if (v.isList())
    for (unsigned int n = 0; n < v.listSize(); ++n)
    rec(*v.listElems()[n]);
    else if (v.type == tAttrs) {
    auto a = v.attrs->find(state.symbols.create("shortName"));
    if (a != v.attrs->end())
    res.push_back(state.forceString(*a->value));
  • replacement in src/hydra-eval-jobs/hydra-eval-jobs.cc at line 89
    [3.396][3.396:402](),[3.402][3.637:652]()
    }
    return "";
    [3.396]
    [3.1405]
    };
    Value * v = drv.queryMeta(name);
    if (v) rec(*v);
    return concatStringsSep(", ", res);