Bug 1914827

Summary: [RHEL8] dnf reposync implicitly downloads source rpms in spite of no --source option
Product: Red Hat Enterprise Linux 8 Reporter: Rajesh Dulhani <rdulhani>
Component: dnfAssignee: Pavla Kratochvilova <pkratoch>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: high Docs Contact:
Priority: medium    
Version: 8.3CC: james.antill, naresh.sukhija_ext, pkratoch
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.21-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:52:16 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:
Bug Depends On: 1951414    
Bug Blocks:    

Description Rajesh Dulhani 2021-01-11 09:58:56 UTC
Description of problem:

dnf reposync implicitly downloads source rpms in spite of no --source option

RHEL8.x, the "dnf reposync" is misbehaving with respect to downloading source packages. Even if no "--source" option is provided, the source rpms still get downloaded.


Version-Release number of selected component (if applicable):

Package - dnf-4.2.23-4.el8.noarch.rpm


Steps to Reproduce:

compile any package, example "hello" as mentioned in the below link

https://docs.fedoraproject.org/en-US/quick-docs/create-hello-world-rpm/


Create a repo with binary and source rpms and host this repo via any method (http etc.)


Create a repo configuration file named /root/hello.conf on both RHEL7 and RHEL8 reposync clients as shown below

cat hello.conf
[main]
metadata_expire = 86400
enabled = 1
[hello]
baseurl = http://<package-server>/hello

Run the reposync command which has following results:


On RHEL7:

reposync --download-metadata -m -c hello.conf -p "/root/hello"
Repository 'hello' is missing name in configuration, using id
hello | 3.0 kB 00:00:00
hello/primary_db | 2.3 kB 00:00:00
hello-2.10-1.el8.x86_64.rpm | 79 kB 00:00:01
#


On RHEL8:

dnf reposync --download-metadata -m -c hello.conf -p "/root/hello" || echo "There were errors. Exit code: $?"
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Repository 'hello' is missing name in configuration, using id.
hello 1.6 kB/s | 1.5 kB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 11 Jan 2021 07:14:08 AM CET.
hello 9.9 kB/s | 7.1 kB 00:00
(1/2): hello-2.10-1.el8.x86_64.rpm 64 kB/s | 79 kB 00:01
(2/2): hello-2.10-1.el8.src.rpm 185 kB/s | 716 kB 00:03
#

As seen in the commands and outputs, we did not specify "--source" option, but still, on RHEL8, the hello-2.10-1.el8.src.rpm also gets downloaded.


Actual results:

source rpm geting downloaded.

Expected results:

source rpm should not get downloaded.

Additional info:

Comment 1 Pavla Kratochvilova 2021-03-10 08:14:06 UTC
Hello,

The behavior you described is expected in RHEL 8. The --source option now only limits the result to source packages only and without the option, all packages are downloaded.

This might have not been clear from the documentation, so this PR improves the wording a little: https://github.com/rpm-software-management/dnf-plugins-core/pull/426

Comment 10 errata-xmlrpc 2021-11-09 19:52:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: dnf security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4464