Bug 2223347 - dnf repoquery pollutes output with repo loading messages
Summary: dnf repoquery pollutes output with repo loading messages
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: amatej
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-17 12:16 UTC by Miro Hrončok
Modified: 2023-08-16 08:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2023-07-17 12:16:46 UTC
When the standard output of `dnf repoquery` is parsed or redirected to a log, it contains:

Updating and loading repositories:
 fedora                                      100% |   9.3 MiB/s |  22.0 MiB |  00m02s
Repositories loaded.


This makes it hard to process. Please move such output to stderr, where it was in dnf4.

Reproducible: Always

Steps to Reproduce:
1. dnf repoquery --whatsupplements tox > output
2. cat output

Actual Results:  
Updating and loading repositories:
 fedora                                 100% |  82.3 KiB/s |  16.5 KiB |  00m00s
Repositories loaded.
pypy3.9-devel-0:7.3.11-4.3.9.fc39.x86_64
python3-devel-0:3.12.0~b4-1.fc39.i686
python3-devel-0:3.12.0~b4-1.fc39.x86_64
python3.10-devel-0:3.10.12-1.fc39.i686
python3.10-devel-0:3.10.12-1.fc39.x86_64
python3.11-devel-0:3.11.4-2.fc39.i686
python3.11-devel-0:3.11.4-2.fc39.x86_64

Expected Results:  
pypy3.9-devel-0:7.3.11-4.3.9.fc39.x86_64
python3-devel-0:3.12.0~b4-1.fc39.i686
python3-devel-0:3.12.0~b4-1.fc39.x86_64
python3.10-devel-0:3.10.12-1.fc39.i686
python3.10-devel-0:3.10.12-1.fc39.x86_64
python3.11-devel-0:3.11.4-2.fc39.i686
python3.11-devel-0:3.11.4-2.fc39.x86_64

Even with -q, the output is:

 fedora                                 100% | 117.3 KiB/s |  16.5 KiB |  00m00s
pypy3.9-devel-0:7.3.11-4.3.9.fc39.x86_64
python3-devel-0:3.12.0~b4-1.fc39.i686
python3-devel-0:3.12.0~b4-1.fc39.x86_64
python3.10-devel-0:3.10.12-1.fc39.i686
python3.10-devel-0:3.10.12-1.fc39.x86_64
python3.11-devel-0:3.11.4-2.fc39.i686
python3.11-devel-0:3.11.4-2.fc39.x86_64

Comment 1 amatej 2023-07-25 04:17:46 UTC
I have looked into it and in the old dnf only the repolist, search and repoquery commands redirect this output to stderr.
It seems kind of confusing.

For processing we plan to add a machine readable format output: https://github.com/rpm-software-management/dnf5/issues/512
I think that would be a better solution.

Comment 2 Miro Hrončok 2023-07-25 08:03:35 UTC
A machine-readable format output sounds great, but please don't let perfect be the enemy of good. Please restore the dnf4 behavior here.

Comment 3 Fedora Release Engineering 2023-08-16 08:13:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


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