Bug 1666648

Summary: dnf download command downloads also a srpm
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: dnf-plugins-coreAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: dmach, jmracek, mblaha, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.4-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-21 02:56:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Mach 2019-01-16 09:48:37 UTC
Reproducer:
$ dnf download --enablerepo=fedora-source filesystem
(1/2): filesystem-3.9-2.fc29.src.rpm
(2/2): filesystem-3.9-2.fc29.x86_64.rpm

Expected behavior:
filesystem-3.9-2.fc29.src.rpm is not downloaded

Additional info:
Downloading sources works as expected:
$ dnf download --enablerepo=fedora-source filesystem --source
filesystem-3.9-2.fc29.src.rpm
# no binary is dowloaded

Comment 1 Daniel Mach 2019-01-16 10:47:28 UTC
Maybe the behavior is correct, but the help is misleading:
  --source              download the src.rpm instead
  --debuginfo           download the -debuginfo package instead

If I understand it correctly, the provided packages on the command line are names of binary RPMs.
When --source is provided, **corresponding** src.rpm is downloaded (e.g. dnf download --source nss -> downloads glibc.src.rpm)
When --debuginfo is provided, **corresponding** debuginfo is downloaded (e.g. dnf download --debuginfo nss -> downloads glibc-debuginfo.*.rpm)
Please note debugsource is NOT downloaded.

Comment 2 Jaroslav Mracek 2019-01-16 13:39:00 UTC
The behavior of DNF differs to you. Yum did not downloaded src by default.

Comment 3 Jaroslav Mracek 2019-01-16 16:07:23 UTC
I created a patch (https://github.com/rpm-software-management/dnf-plugins-core/pull/319) that solves the issue. Please can you verify it?

Comment 4 Fedora Update System 2019-02-18 10:15:27 UTC
libcomps-0.1.10-2.fc29 libdnf-0.26.0-1.fc29 dnf-plugins-core-4.0.4-1.fc29 dnf-plugins-extras-4.0.2-1.fc29 dnf-4.1.0-1.fc29 librepo-1.9.4-1.fc29 createrepo_c-0.12.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fccede810

Comment 5 Fedora Update System 2019-02-19 06:27:26 UTC
createrepo_c-0.12.1-1.fc29, dnf-4.1.0-1.fc29, dnf-plugins-core-4.0.4-1.fc29, dnf-plugins-extras-4.0.2-1.fc29, libcomps-0.1.10-2.fc29, libdnf-0.26.0-1.fc29, librepo-1.9.4-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fccede810

Comment 6 Fedora Update System 2019-02-21 02:56:59 UTC
createrepo_c-0.12.1-1.fc29, dnf-4.1.0-1.fc29, dnf-plugins-core-4.0.4-1.fc29, dnf-plugins-extras-4.0.2-1.fc29, libcomps-0.1.10-2.fc29, libdnf-0.26.0-1.fc29, librepo-1.9.4-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.