aboutsummaryrefslogtreecommitdiff
path: root/build-aux/gitlog-to-changelog
diff options
context:
space:
mode:
authorRoel Janssen <roel@gnu.org>2017-08-02 00:27:35 +0200
committerRoel Janssen <roel@gnu.org>2017-08-02 00:27:35 +0200
commit5077bc3e2e08135048b806a239b07f19b8398161 (patch)
treebf34ddc8cd0a440f83fd1fdac891e0acba83103c /build-aux/gitlog-to-changelog
parentadf5d0a0bc5d675a9ffff857f7121d6c49d26d75 (diff)
downloadguix-5077bc3e2e08135048b806a239b07f19b8398161.tar.gz
guix-5077bc3e2e08135048b806a239b07f19b8398161.zip
gnu: r-biostrings: Update to 2.44.2.
* gnu/packages/bioinformatics.scm (r-biostrings): Update to 2.44.2.
Diffstat (limited to 'build-aux/gitlog-to-changelog')
0 files changed, 0 insertions, 0 deletions
trings(string & res, ForwardIterator i, ForwardIterator j) { res += '['; bool first = true; for ( ; i != j; ++i) { if (first) first = false; else res += ','; printString(res, *i); } res += ']'; } string unparseDerivation(const Derivation & drv) { string s; s.reserve(65536); s += "Derive(["; bool first = true; foreach (DerivationOutputs::const_iterator, i, drv.outputs) { if (first) first = false; else s += ','; s += '('; printString(s, i->first); s += ','; printString(s, i->second.path); s += ','; printString(s, i->second.hashAlgo); s += ','; printString(s, i->second.hash); s += ')'; } s += "],["; first = true; foreach (DerivationInputs::const_iterator, i, drv.inputDrvs) { if (first) first = false; else s += ','; s += '('; printString(s, i->first); s += ','; printStrings(s, i->second.begin(), i->second.end()); s += ')'; } s += "],"; printStrings(s, drv.inputSrcs.begin(), drv.inputSrcs.end()); s += ','; printString(s, drv.platform); s += ','; printString(s, drv.builder); s += ','; printStrings(s, drv.args.begin(), drv.args.end()); s += ",["; first = true; foreach (StringPairs::const_iterator, i, drv.env) { if (first) first = false; else s += ','; s += '('; printString(s, i->first); s += ','; printString(s, i->second); s += ')'; } s += "])"; return s; } bool isDerivation(const string & fileName) { return hasSuffix(fileName, drvExtension); } bool isFixedOutputDrv(const Derivation & drv) { return drv.outputs.size() == 1 && drv.outputs.begin()->first == "out" && drv.outputs.begin()->second.hash != ""; } DrvHashes drvHashes; /* Returns the hash of a derivation modulo fixed-output subderivations. A fixed-output derivation is a derivation with one output (`out') for which an expected hash and hash algorithm are specified (using the `outputHash' and `outputHashAlgo' attributes). We don't want changes to such derivations to propagate upwards through the dependency graph, changing output paths everywhere. For instance, if we change the url in a call to the `fetchurl' function, we do not want to rebuild everything depending on it (after all, (the hash of) the file being downloaded is unchanged). So the *output paths* should not change. On the other hand, the *derivation paths* should change to reflect the new dependency graph. That's what this function does: it returns a hash which is just the hash of the derivation ATerm, except that any input derivation paths have been replaced by the result of a recursive call to this function, and that for fixed-output derivations we return a hash of its output path. */ Hash hashDerivationModulo(StoreAPI & store, Derivation drv) { /* Return a fixed hash for fixed-output derivations. */ if (isFixedOutputDrv(drv)) { DerivationOutputs::const_iterator i = drv.outputs.begin(); return hashString(htSHA256, "fixed:out:" + i->second.hashAlgo + ":" + i->second.hash + ":" + i->second.path); } /* For other derivations, replace the inputs paths with recursive calls to this function.*/ DerivationInputs inputs2; foreach (DerivationInputs::const_iterator, i, drv.inputDrvs) { Hash h = drvHashes[i->first]; if (h.type == htUnknown) { assert(store.isValidPath(i->first)); Derivation drv2 = readDerivation(i->first); h = hashDerivationModulo(store, drv2); drvHashes[i->first] = h; } inputs2[printHash(h)] = i->second; } drv.inputDrvs = inputs2; return hashString(htSHA256, unparseDerivation(drv)); } DrvPathWithOutputs parseDrvPathWithOutputs(const string & s) { size_t n = s.find("!"); return n == s.npos ? DrvPathWithOutputs(s, std::set<string>()) : DrvPathWithOutputs(string(s, 0, n), tokenizeString<std::set<string> >(string(s, n + 1), ",")); } Path makeDrvPathWithOutputs(const Path & drvPath, const std::set<string> & outputs) { return outputs.empty() ? drvPath : drvPath + "!" + concatStringsSep(",", outputs); } bool wantOutput(const string & output, const std::set<string> & wanted) { return wanted.empty() || wanted.find(output) != wanted.end(); } PathSet outputPaths(const Derivation & drv) { PathSet paths; for (auto & i : drv.outputs) paths.insert(i.second.path); return paths; } }