aboutsummaryrefslogtreecommitdiff
path: root/srfi/srfi-64.upstream.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2018-04-16 16:57:35 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2018-04-16 18:33:48 +0200
commit7ee5881dc16655f682449b3ac60a8e3b900e03a2 (patch)
tree30cf0c40b5b59098abead8a2a599ae645cf2da74 /srfi/srfi-64.upstream.scm
parent727ffbd56b016a3cb4a81bd0b03b17ce8164a73b (diff)
downloadguix-7ee5881dc16655f682449b3ac60a8e3b900e03a2.tar.gz
guix-7ee5881dc16655f682449b3ac60a8e3b900e03a2.zip
gnu: webkitgtk: Update to 2.20.1.
* gnu/packages/webkit.scm (webkitgtk): Update to 2.20.1.
Diffstat (limited to 'srfi/srfi-64.upstream.scm')
0 files changed, 0 insertions, 0 deletions
ls.hh" namespace nix { Derivation derivationFromPath(StoreAPI & store, const Path & drvPath) { assertStorePath(drvPath); store.ensurePath(drvPath); return readDerivation(drvPath); } void computeFSClosure(StoreAPI & store, const Path & path, PathSet & paths, bool flipDirection, bool includeOutputs, bool includeDerivers) { if (paths.find(path) != paths.end()) return; paths.insert(path); PathSet edges; if (flipDirection) { store.queryReferrers(path, edges); if (includeOutputs) { PathSet derivers = store.queryValidDerivers(path); foreach (PathSet::iterator, i, derivers) edges.insert(*i); } if (includeDerivers && isDerivation(path)) { PathSet outputs = store.queryDerivationOutputs(path); foreach (PathSet::iterator, i, outputs) if (store.isValidPath(*i) && store.queryDeriver(*i) == path) edges.insert(*i); } } else { store.queryReferences(path, edges); if (includeOutputs && isDerivation(path)) { PathSet outputs = store.queryDerivationOutputs(path); foreach (PathSet::iterator, i, outputs) if (store.isValidPath(*i)) edges.insert(*i); } if (includeDerivers) { Path deriver = store.queryDeriver(path); if (store.isValidPath(deriver)) edges.insert(deriver); } } foreach (PathSet::iterator, i, edges) computeFSClosure(store, *i, paths, flipDirection, includeOutputs, includeDerivers); } Path findOutput(const Derivation & drv, string id) { foreach (DerivationOutputs::const_iterator, i, drv.outputs) if (i->first == id) return i->second.path; throw Error(format("derivation has no output `%1%'") % id); } static void dfsVisit(StoreAPI & store, const PathSet & paths, const Path & path, PathSet & visited, Paths & sorted, PathSet & parents) { if (parents.find(path) != parents.end()) throw BuildError(format("cycle detected in the references of `%1%'") % path); if (visited.find(path) != visited.end()) return; visited.insert(path); parents.insert(path); PathSet references; if (store.isValidPath(path)) store.queryReferences(path, references); foreach (PathSet::iterator, i, references) /* Don't traverse into paths that don't exist. That can happen due to substitutes for non-existent paths. */ if (*i != path && paths.find(*i) != paths.end()) dfsVisit(store, paths, *i, visited, sorted, parents); sorted.push_front(path); parents.erase(path); } Paths topoSortPaths(StoreAPI & store, const PathSet & paths) { Paths sorted; PathSet visited, parents; foreach (PathSet::const_iterator, i, paths) dfsVisit(store, paths, *i, visited, sorted, parents); return sorted; } }