Improve parsing of hydra-build-products
[?]
Jun 19, 2015, 3:20 PM
YHP5DSOOKAXAYHUDMYO6EKX2YAN7DLDQPJX5K52TCP7EXQVP6JAACDependencies
- [2]
24BMQDZAStart of single-process hydra-queue-runner - [3]
WHULPA6SHandle failure with output - [4]
GS4BE6TBAsynchronously compress build logs
Change contents
- edit in src/hydra-queue-runner/build-result.cc at line 5
#include "regex.hh" - edit in src/hydra-queue-runner/build-result.cc at line 30
Regex regex("(([a-zA-Z0-9_-]+)" // type (e.g. "doc")"[[:space:]]+""([a-zA-Z0-9_-]+)" // subtype (e.g. "readme")"[[:space:]]+""(\"[^\"]+\"|[^[:space:]\"]+))" // path (may be quoted)"([[:space:]]+([^[:space:]]+))?" // entry point, true); - replacement in src/hydra-queue-runner/build-result.cc at line 48
productsFile = canonPath(productsFile, true);try {productsFile = canonPath(productsFile, true);} catch (Error & e) { continue; } - replacement in src/hydra-queue-runner/build-result.cc at line 53
// FIXME: handle I/O errorsstring contents;try {contents = readFile(productsFile);} catch (Error & e) { continue; } - replacement in src/hydra-queue-runner/build-result.cc at line 58
auto contents = readFile(productsFile);auto lines = tokenizeString<Strings>(contents, "\n");for (auto & line : tokenizeString<Strings>(contents, "\n")) {BuildProduct product; - replacement in src/hydra-queue-runner/build-result.cc at line 61
for (auto & line : lines) {BuildProduct product;Regex::Subs subs;if (!regex.matches(line, subs)) continue; - replacement in src/hydra-queue-runner/build-result.cc at line 64
auto words = tokenizeString<Strings>(line);if (words.size() < 3) continue;product.type = words.front(); words.pop_front();product.subtype = words.front(); words.pop_front();if (string(words.front(), 0, 1) == "\"") {// FIXME:throw Error("FIXME");} else {product.path = words.front(); words.pop_front();}product.defaultPath = words.empty() ? "" : words.front();product.type = subs[1];product.subtype = subs[2];product.path = subs[3][0] == '"' ? string(subs[3], 1, subs[3].size() - 2) : subs[3];product.defaultPath = subs[5]; - replacement in src/hydra-queue-runner/build-result.cc at line 72
product.path = canonPath(product.path, true);try {product.path = canonPath(product.path, true);} catch (Error & e) { continue; } - replacement in src/hydra-queue-runner/build-result.cc at line 119
// FIXME: handle I/O errorres.releaseName = trim(readFile(p));try {res.releaseName = trim(readFile(p));} catch (Error & e) { continue; }