Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing spaces in dnf5 stdout #790

Closed
glum23 opened this issue Aug 2, 2023 · 3 comments
Closed

Trailing spaces in dnf5 stdout #790

glum23 opened this issue Aug 2, 2023 · 3 comments
Labels
Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@glum23
Copy link
Contributor

glum23 commented Aug 2, 2023

There are trailing spaces in dnf5 stdout describing transactions

      Package                  Arch   Version Repository                     Size          
      Upgrading:                                                                                            
       SuperRipper             x86_64 1.2-1   dnf-ci-thirdparty-updates   0.0   B
         replacing SuperRipper x86_64 1.0-1   dnf-ci-thirdparty           0.0   B

(spaces after Upgrading: till the same position as B in the following line).
It has already broken one step in ci-dnf-stack, see rpm-software-management/ci-dnf-stack#1355
I'd say it can cause problems also with other steps there (e.g. exact matching of outputs) and also with other automatic processing of dnf5 output.

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Aug 2, 2023
@j-mracek j-mracek added Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Aug 3, 2023
@kontura
Copy link
Contributor

kontura commented Aug 9, 2023

I have briefly looked into it and we would probably have to separate the transaction table into multiple libscols_tables with titles like "Upgrading", "Installing"... so we could scols_symbols_set_title_padding(current_table_symbols, "").

This is because currently the section headers ("Upgrading", "Installing"..) are just normal table lines and if we change their padding symbol it will change on all table lines.

One possible problem is that if multiple tables are used they could end up with not aligned columns.

@m-blaha
Copy link
Member

m-blaha commented Aug 9, 2023

The other option might be using scols_table_print_range(table, first, last) smartcols API and keep the line ranges and headings of sections separately.
It's already used for list command, see

void PackageListSections::print() {
// smartcols does not support spanning the text among multiple cells to create
// heading lines. To create sections, print the headings separately and than print
// appropriate range of the table.
bool separator_needed = false;
for (const auto & [heading, first, last] : sections) {
if (separator_needed) {
std::cout << std::endl;
}
if (!heading.empty()) {
std::cout << heading << std::endl;
}
scols_table_print_range(table, first, last);
separator_needed = true;
}
if (!sections.empty()) {
std::cout << std::endl;
}
}

@pkratoch
Copy link
Contributor

pkratoch commented Jan 7, 2025

I think the issue is already resolved. I cannot reproduce it and ci-dnf-stack tests pass when I revert rpm-software-management/ci-dnf-stack@b4dba41 . It looks like this commit fixed it: d4a144d . Therefore, I created a revert of the ci-dnf-stack workaroud rpm-software-management/ci-dnf-stack#1617 and I am closing this issue.

@pkratoch pkratoch closed this as completed Jan 7, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in DNF team Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Archived in project
Development

No branches or pull requests

5 participants