Bug 1577889 - Description in search output is wrapped when stdout isn't terminal
Summary: Description in search output is wrapped when stdout isn't terminal
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-14 11:43 UTC by marekhwd
Modified: 2019-11-12 12:08 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-12 12:08:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description marekhwd 2018-05-14 11:43:53 UTC
This is the output on the terminal:

  [root@localhost ~]# dnf search qutebrowser
  Last metadata expiration check: 0:14:53 ago on Mon 14 May 2018 01:18:23 PM CEST.
  =========================== Name Exactly Matched: qutebrowser ============================
  qutebrowser.noarch : A keyboard-driven, vim-like browser based on PyQt5 and QtWebEngine
  [root@localhost ~]# 


This is what gets into pipe:

  [root@localhost ~]# dnf search qutebrowser | cat
  Last metadata expiration check: 0:15:23 ago on Mon 14 May 2018 01:18:23 PM CEST.
  ====================== Name Exactly Matched: qutebrowser =======================
  qutebrowser.noarch : A keyboard-driven, vim-like browser based on PyQt5 and
                     : QtWebEngine
  [root@localhost ~]# dnf search qutebrowser

For some weird reason DNF wraps output to 80 columns but only when stdout isn't terminal. Frequently the output of DNF search needs to be piped into less and this wrapping makes the output hard to read, see:

  GeoIP.x86_64 : Library for country/city/organization to IP address or hostname
               : mapping
  dnf.noarch : Package manager forked from Yum, using libsolv as a dependency
             : resolver
  GeoIP.i686 : Library for country/city/organization to IP address or hostname
             : mapping
  apache-commons-exec.noarch : Java library to reliably execute external processes
                             : from within the JVM
  aqbanking.i686 : A library for online banking functions and financial data
                 : import/export
  aqbanking.x86_64 : A library for online banking functions and financial data
                   : import/export
  golang-github-chzyer-logex-devel.noarch : A golang log lib, supports tracking
                                          : and level, wrap by standard log lib


DNF is the only command line tool I know that behaves like this. I can't think of any valid use case except for sending mails, but that's not what 99% users of DNF users want when they're using 'dnf search'.

This also makes it much harder to parse output of DNF with standard Unix tools.

Comment 1 Jaroslav Mracek 2018-05-21 11:17:06 UTC
I think if you will use -q option the output will be more clear, but headers will still remain and we do not plan to remove it. Additionally I would recommend you to use repoquery for parsing outputs especially with --queryformat option. I am sorry but we cannot do more for you.

Comment 2 Jan Kurik 2018-08-14 10:02:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 3 Jaroslav Mracek 2019-05-06 06:51:16 UTC
I create a patch that improves behavior for info/search/and repolist commands. https://github.com/rpm-software-management/dnf/pull/1391

Comment 4 BugMasta 2019-07-17 13:53:19 UTC
OP, please refer to this bug, and just give up:

https://bugzilla.redhat.com/show_bug.cgi?id=584525


Devs have no intention to fix this bug. Ever.

All they will do is make irrelevant suggestions about repoquery, etc.

If you point out this bug makes it a PITA to do a simple, sensibe thing like "dnf install blah | grep somerepo", to see what dependencies of blah will get pulled in from a certain repo, you'll just be ignored.

Comment 5 BugMasta 2019-07-17 13:54:57 UTC
I'll just add, that this bug was reported in 2010, vs yum.

So yeah. Just do your sanity a favour, and forget about it.

It will never be fixed.

Comment 6 Ben Cotton 2019-10-31 19:03:19 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 amatej 2019-11-12 12:08:07 UTC
Given that this is a relatively minor output problem I am closing this as NEXTRELEASE.
It is fixed in dnf 4.2.15 (>= Feodra 30)


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