diff options
author | Alois Wohlschlager <alois1@gmx-topmail.de> | 2024-08-21 17:28:42 +0200 |
---|---|---|
committer | Alois Wohlschlager <alois1@gmx-topmail.de> | 2024-08-21 17:28:42 +0200 |
commit | de552c42cb304ff320bc042a37b2f46ecd20c63b (patch) | |
tree | 825892fdf6f62b97b3636d7d1f824f0089278c7f /src | |
parent | e38410799b5b78b2fc2b0c9e4b1dc0dfc5801097 (diff) |
Stop the logger in legacy commands again
Commit 0dd1d8ca1cdccfc620644a7f690ed35bcd2d1e74 included an accidental revert
of 1461e6cdda06f7f461114cce5b415f6d50381311 (actually slightly worse), leading
to the progress bar not being stopped properly when a legacy command was
invoked with `--log-format bar` (or similar options that show a progress bar).
Move the progress bar stopping code to its proper place again to fix this
regression.
Change-Id: I676333da096d5990b717a387924bb988c9b73fab
Diffstat (limited to 'src')
-rw-r--r-- | src/nix/main.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc index e84e4f310..97f4b4a63 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -353,6 +353,9 @@ void mainWrapped(int argc, char * * argv) argv++; argc--; } + // Clean up the progress bar if shown using --log-format in a legacy command too. + // Otherwise, this is a harmless no-op. + Finally f([] { logger->pause(); }); { auto legacy = (*RegisterLegacyCommand::commands)[programName]; if (legacy) return legacy(argc, argv); @@ -361,7 +364,6 @@ void mainWrapped(int argc, char * * argv) evalSettings.pureEval = true; setLogFormat(LogFormat::bar); - Finally f([] { logger->pause(); }); settings.verboseBuild = false; // FIXME: stop messing about with log verbosity depending on if it is interactive use if (isatty(STDERR_FILENO)) { |