mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
libmain: fix ignoring empty lines in the print-build-logs option
This commit is contained in:
parent
deb3533eab
commit
01c96f9fd5
1 changed files with 14 additions and 16 deletions
|
@ -287,23 +287,21 @@ public:
|
||||||
|
|
||||||
else if (type == resBuildLogLine || type == resPostBuildLogLine) {
|
else if (type == resBuildLogLine || type == resPostBuildLogLine) {
|
||||||
auto lastLine = chomp(getS(fields, 0));
|
auto lastLine = chomp(getS(fields, 0));
|
||||||
if (!lastLine.empty()) {
|
auto i = state->its.find(act);
|
||||||
auto i = state->its.find(act);
|
assert(i != state->its.end());
|
||||||
assert(i != state->its.end());
|
ActInfo info = *i->second;
|
||||||
ActInfo info = *i->second;
|
if (printBuildLogs) {
|
||||||
if (printBuildLogs) {
|
auto suffix = "> ";
|
||||||
auto suffix = "> ";
|
if (type == resPostBuildLogLine) {
|
||||||
if (type == resPostBuildLogLine) {
|
suffix = " (post)> ";
|
||||||
suffix = " (post)> ";
|
|
||||||
}
|
|
||||||
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
|
|
||||||
} else {
|
|
||||||
state->activities.erase(i->second);
|
|
||||||
info.lastLine = lastLine;
|
|
||||||
state->activities.emplace_back(info);
|
|
||||||
i->second = std::prev(state->activities.end());
|
|
||||||
update(*state);
|
|
||||||
}
|
}
|
||||||
|
log(*state, lvlInfo, ANSI_FAINT + info.name.value_or("unnamed") + suffix + ANSI_NORMAL + lastLine);
|
||||||
|
} else {
|
||||||
|
state->activities.erase(i->second);
|
||||||
|
info.lastLine = lastLine;
|
||||||
|
state->activities.emplace_back(info);
|
||||||
|
i->second = std::prev(state->activities.end());
|
||||||
|
update(*state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue