RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1788154 - Adding a trailing comma to excludes option causes all items listed for exclusion to be ignored.
Summary: Adding a trailing comma to excludes option causes all items listed for exclus...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: yum
Version: 8.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Jaroslav Rohel
QA Contact: Luca Berton
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks: 1825061
TreeView+ depends on / blocked
 
Reported: 2020-01-06 14:51 UTC by lnarvaez
Modified: 2023-12-15 17:08 UTC (History)
6 users (show)

Fixed In Version: dnf-4.2.21-1.el8
Doc Type: Bug Fix
Doc Text:
.Trailing comma no longer causes entries removal in an `append` type option Previously, adding a trailing comma (an empty entry at the end of the list) to an `append` type option (for example, `exclude`, `excludepkgs`, `includepkgs`) caused all entries in the option to be removed. Also, adding two commas (an empty entry) caused that only entries after the commas were used. With this update, empty entries other than leading commas (an empty entry at the beginning of the list) are ignored. As a result, only the leading comma now removes existing entries from the `append` type option, and the user can use it to overwrite these entries.
Clone Of:
Environment:
Last Closed: 2020-11-04 01:52:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:4510 0 None None None 2020-11-04 01:52:39 UTC

Description lnarvaez 2020-01-06 14:51:54 UTC
Description of problem:

Adding a trailing comma to excludes option causes all items listed for exclusion to be ignored. 


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

 
Steps to Reproduce:

1. Run the following command to exclude items from update.  Kernel packages 
   will still be listed for installation. 

     # yum  update --exclude=kernel*,ansible,
...
Installing:
 kernel-core                                             x86_64                  4.18.0-147.0.3.el8_1                                             rhel-8-for-x86_64-baseos-rpms                               25 M
 kernel                                                  x86_64                  4.18.0-147.0.3.el8_1                                             rhel-8-for-x86_64-baseos-rpms                              1.5 M
 kernel-modules                                          x86_64                  4.18.0-147.0.3.el8_1                                             rhel-8-for-x86_64-baseos-rpms                               22 M
... 


2. Running yum update again without the trailing comma excludes kernel as 
   expected. 

     # yum  update --exclude=kernel*,ansible,

 No kernel packages will be listed for update

Comment 1 Jaroslav Rohel 2020-01-13 09:51:10 UTC
There are "append" options in the DNF (excludepkgs, includepkgs, installonlypkgs, tsflags). The "append" options differs from others in setting process - the new values are appended to the original value, they do not override it.

All examples below assumes "excludepkgs = iftop" in the configuration file.

Example 1:
"dnf  update --exclude=kernel*,ansible --exclude=mc" is executed.
The "--exclude" argument from command line appends values. So iftop, kernel*, ansible, mc are excluded.
But sometimes an user wants to clear/replace values defined in "append" options.  So, all "append" options have the way of clearing an existing value. -> Setting empty value clears all existing values.

Example 2:
"dnf  update --exclude= --exclude=kernel*,ansible --exclude=mc" is executed.
Arguments are solved from left to right. The first "--exclude=" clears existing excludes and the second and the thirds "--exclude" add new excludes. So kernel*, ansible, mc are excluded.

Example 3:
"dnf  update --exclude=kernel*,ansible --exclude= --exclude=mc" is executed.
Arguments are solved from left to right. The second "--exclude=" clears existing excludes and the thirds "--exclude" add new excludes. So mc is excluded.

Example 4:
"dnf  update --exclude=kernel*,ansible --exclude=mc --exclude=" is executed.
Arguments are solved from left to right. The last "--exclude=" clears existing excludes. So nothing is excluded.

A notation of command can be shortened (only one "--exclude").

Example 5:
Instead of "dnf  update --exclude= --exclude=kernel*,ansible --exclude=mc" user can write "dnf  update --exclude=,kernel*,ansible,mc". Before first ',' character is empty item.

Example 6:
Instead of "dnf  update --exclude=kernel*,ansible --exclude= --exclude=mc" user can write "dnf  update --exclude=kernel*,ansible,,mc". Before "mc" is empty value (two commas).

Example 7:
Instead of "dnf  update --exclude=kernel*,ansible --exclude=mc --exclude=" user can write "dnf  update --exclude=kernel*,ansible,mc,". The empty value is behind the last ','. Nothing is excluded.

The example 7 is the reported problem. It is not a problem but a feature of DNF. But I think that the feature is not correctly described in the documentation.

--------
We suggest:
1. to check/improve documentation
2. to remove support for Example 6 and Example 7 from DNF. It is redundant. The "--exclude=kernel*,ansible,,mc" is equivalent to "--exclude=,mc". The "--exclude=kernel*,ansible,mc," is equivalent to "--exclude=". And to keep only first shortened notation (Example 5) "--exclude=,value".

Comment 13 errata-xmlrpc 2020-11-04 01:52:25 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 (yum 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/RHEA-2020:4510


Note You need to log in before you can comment on or make changes to this bug.