Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in dnf versionlock makes it unusable #1895

Open
scaronni opened this issue Nov 24, 2024 · 1 comment
Open

Bugs in dnf versionlock makes it unusable #1895

scaronni opened this issue Nov 24, 2024 · 1 comment

Comments

@scaronni
Copy link

scaronni commented Nov 24, 2024

The plugin versionlock does not work properly. Taking into account the differences compared to the DNF4 plugin, it still does not behave correctly.

At Nvidia we're trying to get away from packages with the branch name in the actual package name and would like to switch to standard tools for doing branch locking. It works fine in DNF4, it does not in DNF5.

First issue: automatic filtering. Test is done on the same repository.

DNF4:

# dnf versionlock add \*nvidia\*565\*
Last metadata expiration check: 2:08:07 ago on Sun 24 Nov 2024 09:19:13 AM CET.
Adding versionlock on: nvidia-persistenced-3:565.57.01-1.fc40.*
Adding versionlock on: nvidia-driver-3:565.57.01-4.fc40.*
Adding versionlock on: nvidia-settings-3:565.57.01-1.fc40.*
Adding versionlock on: compat-nvidia-repo-3:565.57.01-2.fc40.*
Adding versionlock on: akmod-nvidia-3:565.57.01-1.fc40.*
Adding versionlock on: nvidia-driver-cuda-3:565.57.01-4.fc40.*
Adding versionlock on: nvidia-xconfig-3:565.57.01-1.fc40.*
Adding versionlock on: nvidia-kmod-common-3:565.57.01-2.fc40.*
Adding versionlock on: nvidia-libXNVCtrl-devel-3:565.57.01-1.fc40.*
Adding versionlock on: kmod-nvidia-3:565.57.01-1.fc40.*
Adding versionlock on: xorg-x11-nvidia-3:565.57.01-4.fc40.*
Adding versionlock on: libnvidia-fbc-3:565.57.01-4.fc40.*
Adding versionlock on: nvidia-libXNVCtrl-3:565.57.01-1.fc40.*
Adding versionlock on: libnvidia-cfg-3:565.57.01-4.fc40.*
Adding versionlock on: dkms-nvidia-3:565.57.01-1.fc40.*
Adding versionlock on: nvidia-driver-libs-3:565.57.01-4.fc40.*
Adding versionlock on: libnvidia-ml-3:565.57.01-4.fc40.*
Adding versionlock on: nvidia-driver-cuda-libs-3:565.57.01-4.fc40.*
Adding versionlock on: nvidia-modprobe-3:565.57.01-1.fc40.*

Then I can edit the versionlock.list file very simply by moving wildcards back and forth (ex. to keep stuff on the 565 branch).

DNF5:

# dnf versionlock add \*nvidia\*565\*
Updating and loading repositories:
Repositories loaded.
Adding versionlock on "dkms-nvidia = 3:565.57.01-1.fc41".
Adding versionlock on "libnvidia-cfg = 3:565.57.01-4.fc41".
Adding versionlock on "nvidia-kmod-common = 3:565.57.01-2.fc41".

On DNF5 it's not picking all the packages, I can't figure out what is the logic that is being applied for the wildcard selection, it seems pretty random.

Second issue: editing the file. According to the man page, the /etc/dnf/versionlock.toml accepts various keys in the key field:

# keep package bash on version 0:5.2.15-5.fc39
[[packages]]
name = "bash"               # name of the package
comment = "description"     # optional description of the entry
[[packages.conditions]]     # conditions for the package "bash"
key = "evr"                 # epoch, version, evr, and arch keys are supported
comparator = "="            # <, <=, =, >=, >, and != operators are supported
value = "0:5.2.15-5.fc39"   # pattern to match

But actually none of those is supported, so I can't say for example pick anything which has the 565 version:

# cat /etc/dnf/versionlock.toml 
version = "1.0"

[[packages]]
name = "nvidia-driver"

[[packages.conditions]]
key = "version"
comparator = ">="
value = "565"
[[packages.conditions]]
key = "version"
comparator = "<"
value = "570"
# dnf versionlock list
Package name: nvidia-driver
version >= 565 # invalid condition key "version"
version < 570 # invalid condition key "version"
@scaronni
Copy link
Author

For the second case, I can make it work like this, but it requires also the epoch and is not like the man page describes:

version = "1.0"

[[packages]]
name = "nvidia-driver"

[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:565"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:570"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant