Bug 1782052

Summary: dnf versionlock will accept equivalent package names to add or exclude multiple times
Product: [Fedora] Fedora Reporter: David H. Gutteridge <dhgutteridge>
Component: dnf-plugins-coreAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 31CC: amatej, dmach, jmracek, mblaha, packaging-team-maint, pkratoch, praiskup, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-4.0.13-1.fc31 dnf-plugins-core-4.0.13-1.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-25 06:34: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 David H. Gutteridge 2019-12-11 04:27:40 UTC
Description of problem:
The dnf versionlock plugin will accept equivalent package names to add or exclude multiple times, and in a contradictory manner: it will record add and exclude actions for the same NEVRA form.

$ sudo dnf versionlock add git
Adding versionlock on: git-0:2.23.0-1.fc31.*
$ sudo dnf versionlock exclude git
Adding exclude on: git-0:2.23.0-1.fc31.*
$ sudo dnf versionlock add git
Adding versionlock on: git-0:2.23.0-1.fc31.*
$ dnf versionlock list
git-0:2.23.0-1.fc31.*
!git-0:2.23.0-1.fc31.*
git-0:2.23.0-1.fc31.*

The fix seems pretty simple. I will submit it as a GitHub pull request. 

Version-Release number of selected component (if applicable):
dnf-plugins-core 4.0.12

How reproducible:
Always.

Steps to Reproduce:
See above.

Comment 1 David H. Gutteridge 2019-12-11 04:37:16 UTC
Proposed fix submitted as https://github.com/rpm-software-management/dnf-plugins-core/pull/376

Comment 2 Fedora Update System 2020-01-16 21:13:04 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-1.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 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-2020-66c974fdb6

Comment 3 Fedora Update System 2020-01-16 21:39:42 UTC
dnf-4.2.18-1.fc31, dnf-plugins-core-4.0.13-1.fc31, libdnf-0.43.1-1.fc31, microdnf-3.4.0-1.fc31 has been pushed to the Fedora 31 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-2020-9542e3ccfd

Comment 4 Fedora Update System 2020-01-25 06:34:48 UTC
dnf-4.2.18-1.fc31, dnf-plugins-core-4.0.13-1.fc31, libdnf-0.43.1-1.fc31, microdnf-3.4.0-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2020-02-07 01:03:38 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-2.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 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-2020-66c974fdb6

Comment 6 Fedora Update System 2020-02-22 01:16:13 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-2.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.