Bug 2034736

Summary: reposync -n downloads more than it should
Product: Red Hat Enterprise Linux 8 Reporter: jcastran
Component: dnf-plugins-coreAssignee: amatej
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: alexander.j.barris, amatej, bill.muller, james.antill, kemyers, mbanas, mmatsuya, pkratoch, sujagtap
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.21-12.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 10:53:15 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 jcastran 2021-12-21 21:22:26 UTC
Description of problem:
Using reposync -n to create a repository, repomanage to remove old packages, and reposync -n again results in packages being removed and redownloaded.

reposync is incorrectly downloading additional packages it should not be (when using -n)

Version-Release number of selected component (if applicable):
yum-utils-4.0.21-3.el8.noarch

How reproducible:
everytime

Steps to Reproduce:
1. # reposync -n --download-metadata --repoid=rhel-8-for-x86_64-appstream-rpms
2. # repomanage --old rhel-8-for-x86_64-appstream-rpms/ --keep 2 | xargs rm  
3. # reposync -n --download-metadata --repoid=rhel-8-for-x86_64-appstream-rpms

Actual results:
close to 850 module packages being pulled in (with --newest-only)

Expected results:
DNF to pull in no new packages after running the repomanage command, 

Additional info:

Comment 7 Jaroslav Mracek 2022-04-07 07:57:07 UTC
Thank you very much for a discussion and for the patch https://github.com/rpm-software-management/dnf-plugins-core/pull/452. I understand that the patch will resolve the user cases but it will be a significant change in behavior that can be also confusing because DNF will provide a different information according to metadata. I suggest that we can implement the new behavior but not for a --new option but we should create a new option. It will prevent from breaking anything else, but it will provide requested functionality.

Comment 19 Bill Muller 2022-09-21 22:30:52 UTC
It appears that dnf-plugins-core-4.0.21-11.el8 is still the current version, is there an expected release date for the new packages, dnf-plugins-core-4.0.21-12.el8?

Also, will a new option be introduced to achieve the desired behavior described in the original post?

Comment 20 amatej 2022-10-11 05:04:59 UTC
The new dnf-plugins-core-4.0.21-12.el8 should be present in 8.7.0 rhel.
And yes there is a new option for repomanage --oldonly that prints just rpms that are not in the newest stream version.

Comment 22 errata-xmlrpc 2022-11-08 10:53:15 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 (dnf-plugins-core bug fix and enhancement 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/RHBA-2022:7759