Bug 2013332

Summary: Locking a version of a not installed package disallows locking other versions later
Product: Red Hat Enterprise Linux 8 Reporter: Roberto <moreda>
Component: dnf-plugins-coreAssignee: Nicola Sella <nsella>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: james.antill, mbanas, mblaha, nsella, pkratoch
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.21-7.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:23:48 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 Roberto 2021-10-12 15:39:07 UTC
Description of problem:
When locking a specific version of a not installed package then it is not possible to lock the rest of versions of the same package. 

Version-Release number of selected component (if applicable):
dnf-plugins-core-0:4.0.18-4.el8.noarch
python3-dnf-plugin-versionlock-0:4.0.18-4.el8.noarch

How reproducible:
Trivial to reproduce.

Steps to Reproduce:
1. Lock a version of a not installed package with several versions available:
# dnf versionlock add bind-32:9.11.26-3.el8
2. Lock a package-name-spec that includes the package already locked:
# dnf versionlock add bind

Actual results:
There is a lock for the specific version of the package but no for the others.

Expected results:
After the second dnf versionlock call, locks for all versions of the not installed package.

Additional info:
This is related to https://bugzilla.redhat.com/show_bug.cgi?id=2013324.

In this case, as soon as there is a entry in the locklist that satisfies the criteria set by _match, then there is no further checking for the versions of a package that *it is not installed*. This is important as far as the semantics are to lock all available versions if the package is not installed.

Comment 2 Nicola Sella 2021-11-19 12:18:28 UTC
Hello,

I updated the documentation for this bug, saying that dnf versionlock does not update the package list
if a specific version is locked. This change made the docs more clear.

However, I would like to ask you for more information about your use case for this bug.
Do you need this change for a specific reason?

In this case, I would mark this as RFE and work on it. If not, I would rather leave things as they are
and close this with doc update.
At this state, what you can do to avoid your issue is: every time you require to add a package, you
should delete all the other binds if you want to be sure of what is locked.

  dnf versionlock delete bind
  dnf versionlock add bind

Comment 10 errata-xmlrpc 2022-05-10 15:23:48 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:2052

Comment 11 Red Hat Bugzilla 2023-09-15 01:36:33 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days