Bug 2231262 - Wrap license at word boundary
Summary: Wrap license at word boundary
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: rawhide
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: rpm-software-management
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-11 07:21 UTC by Dennis Brendel
Modified: 2024-05-28 14:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-28 13:48:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management dnf5 issues 840 0 None open info: Wrap text at word boundaries 2023-08-28 10:47:25 UTC

Description Dennis Brendel 2023-08-11 07:21:30 UTC
When running `dnf5 info <package>` I expected the text to be wrapped consistently, depending on the terminal width.

While at least the description field seems to wrap at around 88 characters the license field only wraps at the terminal width.


Reproducible: Always

Steps to Reproduce:
1. Terminal is wider than 88 characters
2. dnf5 info vim
Actual Results:  
# echo $COLUMNS
120
# dnf5 info vim
Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : vim-enhanced
Epoch           : 2
Version         : 9.0.1677
Release         : 2.fc38
Architecture    : x86_64
Installed size  : 4.0 MiB
Source          : vim-9.0.1677-2.fc38.src.rpm
From repository : updates
Summary         : A version of the VIM editor which includes recent enhancements
URL             : http://www.vim.org/
License         : Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-only OR Vim) AND Apache-2.0 AND BSD-2-
                : Clause AND BSD-3-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND OPUBL-1.0
Description     : VIM (VIsual editor iMproved) is an updated and improved version of the
                : vi editor.  Vi was the first real screen-based editor for UNIX, and is
                : still very popular.  VIM improves on vi by adding new features:
                : multiple windows, multi-level undo, block highlighting and more.  The
                : vim-enhanced package contains a version of VIM with extra, recently
                : introduced features like Python and Perl interpreters.
                : 
                : Install the vim-enhanced package if you'd like to use a version of the
                : VIM editor which includes recently added enhancements like
                : interpreters for the Python and Perl scripting languages.  You'll also
                : need to install the vim-common package.


Expected Results:  
Something like this:
# dnf5 info vim
Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : vim-enhanced
Epoch           : 2
Version         : 9.0.1677
Release         : 2.fc38
Architecture    : x86_64
Installed size  : 4.0 MiB
Source          : vim-9.0.1677-2.fc38.src.rpm
From repository : updates
Summary         : A version of the VIM editor which includes recent enhancements
URL             : http://www.vim.org/
License         : Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-only O
                : R Vim) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or
                : -later AND GPL-3.0-or-later AND OPUBL-1.0
Description     : VIM (VIsual editor iMproved) is an updated and improved version of the
                : vi editor.  Vi was the first real screen-based editor for UNIX, and is
                : still very popular.  VIM improves on vi by adding new features:
                : multiple windows, multi-level undo, block highlighting and more.  The
                : vim-enhanced package contains a version of VIM with extra, recently
                : introduced features like Python and Perl interpreters.
                : 
                : Install the vim-enhanced package if you'd like to use a version of the
                : VIM editor which includes recently added enhancements like
                : interpreters for the Python and Perl scripting languages.  You'll also
                : need to install the vim-common package.

Comment 1 Zbigniew Jędrzejewski-Szmek 2023-08-11 14:05:12 UTC
In general, word-breaks shouldn't be done. E.g. for the license stuff,
half of the license string might also be a valid license, and then the
result could be quite confusing. So I think the license should be handles
like %description, with the words wrapped whole.

Comment 2 Petr Pisar 2023-08-14 13:48:10 UTC
Both License and Description are wrapped at character boundary (I hope than not at byte boundary) with dnf5-5.1.1-20230814004427.13.gfe78108c.fc40.x86_64 and libsmartcols-2.39.1-3.fc39.x86_64 according to a size of the terminal:

# echo $COLUMNS 
85
root@fedora-40:~ # dnf5 --disablerepo=rawhide --enablerepo=f40-build  info vim-enhanced
Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : vim-enhanced
Epoch           : 2
Version         : 9.0.1712
Release         : 1.fc40
Architecture    : x86_64
Installed size  : 4.0 MiB
Source          : vim-9.0.1712-1.fc40.src.rpm
From repository : f40-build
Summary         : A version of the VIM editor which includes recent enhancements
URL             : http://www.vim.org/
License         : Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-onl
                : y OR Vim) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-
                : 2.0-or-later AND GPL-3.0-or-later AND OPUBL-1.0
Description     : VIM (VIsual editor iMproved) is an updated and improved version of 
                : the
                : vi editor.  Vi was the first real screen-based editor for UNIX, and
                :  is
                : still very popular.  VIM improves on vi by adding new features:
                : multiple windows, multi-level undo, block highlighting and more.  T
                : he
                : vim-enhanced package contains a version of VIM with extra, recently
                : introduced features like Python and Perl interpreters.
                : 
                : Install the vim-enhanced package if you'd like to use a version of 
                : the
                : VIM editor which includes recently added enhancements like
                : interpreters for the Python and Perl scripting languages.  You'll a
                : lso
                : need to install the vim-common package.
Vendor          : Fedora Project

Observe T-he and a-lso line ends.

The description is pre-wrapped in an RPM package. This (80 columns) is prescribed by Fedora packaging guidelines <https://docs.fedoraproject.org/en-US/packaging-guidelines/#_summary_and_description>. The description is a text block while the license is a one-line string. That's the difference between Description and License.

So DNF5 handles both fields consistently. What you observe is how the data are stored in RPM.

I agree that rather then breaking words (which is difficult to do correctly without a language-specific dictionary), DNF5 should rather break lines per words. Excessively long words are a problem. I would rather keep them overflowing, but I can image technical limitations in smartcols library forcing to break them in all cases.

Comment 3 Dennis Brendel 2023-08-15 15:11:22 UTC
Thank you for the explanation! Yeah, rpm -qi show the exact same, so that makes sense.

I agree on that the word boundary should be were lines break. There could be a workaround that line breaks for licenses happen on the [andANDorOR] boundary, if that's covering all cases. That might even improve readability.

But it's still just a cosmetic thing.

Comment 4 Aoife Moloney 2024-05-28 13:48:32 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Zbigniew Jędrzejewski-Szmek 2024-05-28 14:08:01 UTC
No change with dnf5-5.2.0.0-0.20240421005245.5.1.17+209.gc8c548c3.fc41.x86_64.


Note You need to log in before you can comment on or make changes to this bug.