-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Describe the bug
When using excludepkgs or exclude in tdnf, with a custom repo configuration on Photon OS 5, I am unable to get tdnf to properly acknowledge globbing like dnf does on other operating systems (ex. Rocky Linux).
exclude seems to not be supported by tdnf, even though it is supported by yum and by dnf.
Reproduction steps
I have the following repo file: /etc/yum.repos.d/salt.repo
[salt-repo-3006-lts]
name=Salt Repo for Salt v3006 LTS
baseurl=https://packages.broadcom.com/artifactory/saltproject-rpm/
skip_if_unavailable=True
priority=10
enabled=1
enabled_metadata=1
gpgcheck=1
excludepkgs=*3007* *3008* *3009* *3010*
gpgkey=https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
[salt-repo-3007-sts]
name=Salt Repo for Salt v3007 STS
baseurl=https://packages.broadcom.com/artifactory/saltproject-rpm/
skip_if_unavailable=True
priority=10
enabled=0
enabled_metadata=1
gpgcheck=1
excludepkgs=*3006* *3008* *3009* *3010*
gpgkey=https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
[salt-repo-latest]
name=Salt Repo for Salt LATEST release
baseurl=https://packages.broadcom.com/artifactory/saltproject-rpm/
skip_if_unavailable=True
priority=10
enabled=0
enabled_metadata=1
gpgcheck=1
gpgkey=https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
salt-repo-3006-lts is enabled by default, but excludepkgs (or exclude, as an alternative) doesn't look to work as expected.
# Will install salt-minion 3007.1 (latest *3007* release), when *3007* should be excluded
# This is essentially the same as "salt-repo-latest" repo being used instead
tdnf install salt-minion
Expected behavior
Expected to work like when using dnf:
# Will install salt-minion 3006.9 (current latest *3006*), as *3007* should be excluded
tdnf install salt-minion
Details from docs on DNF conf options:
excludepkgs
listExclude packages of this repository, specified by a name
or a glob and separated by a comma, from all operations.
Can be disabled using --disableexcludes command line
switch. Defaults to [].
With a list being defined as:
list
It is an option that could represent one or more strings
separated by space or comma characters.
Originally, I was using exclude because dnf supports it - perhaps so that repo files can be recognized both by systems using yum and dnf. Details from docs on YUM conf settings, where users may have repos using these YUM configs:
exclude=package_name [more_package_names]
This option allows you to exclude packages by keyword during installation/updates. Listing multiple packages for exclusion can be accomplished by quoting a space-delimited list of packages. Shell globs using wildcards (for example,*and?) are allowed.
Additional context
Can try doing the same on Rocky Linux, via dnf, or other operating systems that are using yum (with exclude instead of excludepkgs). The functionality will differ from tdnf in both cases.
- Best case scenario: Support both
excludepkgsandexcludeproperly filtering out packages via globbing (has most universal benefit forrepoconfig files) - Second best case scenario: Support
excludepkgsproperly filtering out packages via globbing