diff options
| author | Julian Andres Klode <jak@debian.org> | 2024-04-12 18:16:23 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2024-04-12 18:16:23 +0000 |
| commit | b8e77c400eaec5983772f50d3f728373b5981866 (patch) | |
| tree | ae0ba3624bef3e1549e2bf0f555590eb98e6513b /apt-pkg/contrib/progress.cc | |
| parent | 81c65f7e86b8f16eaaa91d9c205a594b0ebde159 (diff) | |
| parent | f725565ae69a06d0ad5747881b6f54a19c0c1763 (diff) | |
Merge branch 'terse-ui' into 'main'
Introduce new output format for apt(8)
See merge request apt-team/apt!337
Diffstat (limited to 'apt-pkg/contrib/progress.cc')
| -rw-r--r-- | apt-pkg/contrib/progress.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index a2c4332ca..df068e43a 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -153,13 +153,15 @@ void OpTextProgress::Done() { if (NoUpdate == false && OldOp.empty() == false) { - char S[300]; + char S[300] = {}; if (_error->PendingError() == true) snprintf(S,sizeof(S),_("%c%s... Error!"),'\r',OldOp.c_str()); - else + else if (not _config->FindB("APT::Internal::OpProgress::EraseLines", true)) snprintf(S,sizeof(S),_("%c%s... Done"),'\r',OldOp.c_str()); Write(S); - cout << endl; + // FIXME: apt-cdrom relies on this end of line being printed + if (_error->PendingError() || not _config->FindB("APT::Internal::OpProgress::EraseLines", true)) + cout << endl; OldOp = string(); } @@ -200,7 +202,8 @@ void OpTextProgress::Update() { snprintf(S,sizeof(S),"\r%s",OldOp.c_str()); Write(S); - cout << endl; + if (_config->FindB("APT::Internal::OpProgress::EraseLines", true)) + cout << endl; } // Print the spinner. Absolute progress shows us a time progress. |
