diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-15 18:48:14 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-15 18:49:01 +0200 |
commit | fc35b4d7d95b2848db482021df4f4500ac142080 (patch) | |
tree | 474f349e43ac0a34d59b541a8df3b398c1157fad | |
parent | e52898659db4e34e7f50963f8331e83dedb9fc1b (diff) |
Only erase OpProgress lines in output version 3.0
While this is an interactive only change that doesn't break
parsing someone got unhappy.
-rw-r--r-- | apt-pkg/contrib/progress.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index df068e43a..5f440a749 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -156,12 +156,12 @@ void OpTextProgress::Done() char S[300] = {}; if (_error->PendingError() == true) snprintf(S,sizeof(S),_("%c%s... Error!"),'\r',OldOp.c_str()); - else if (not _config->FindB("APT::Internal::OpProgress::EraseLines", true)) + else if (not _config->FindB("APT::Internal::OpProgress::EraseLines", _config->FindI("APT::Output-Version") >= 30)) snprintf(S,sizeof(S),_("%c%s... Done"),'\r',OldOp.c_str()); Write(S); // FIXME: apt-cdrom relies on this end of line being printed - if (_error->PendingError() || not _config->FindB("APT::Internal::OpProgress::EraseLines", true)) - cout << endl; + if (_error->PendingError() || not _config->FindB("APT::Internal::OpProgress::EraseLines", _config->FindI("APT::Output-Version") >= 30)) + cout << endl; OldOp = string(); } @@ -202,8 +202,8 @@ void OpTextProgress::Update() { snprintf(S,sizeof(S),"\r%s",OldOp.c_str()); Write(S); - if (_config->FindB("APT::Internal::OpProgress::EraseLines", true)) - cout << endl; + if (_config->FindB("APT::Internal::OpProgress::EraseLines", _config->FindI("APT::Output-Version") >= 30)) + cout << endl; } // Print the spinner. Absolute progress shows us a time progress. |