Skip to content

Conversation

@foxxx0
Copy link
Member

@foxxx0 foxxx0 commented Nov 4, 2021

As stated in the manpage [1] yum versionlock supports package-wildcard
and does not require exact matches for package-names.
The following is valid versionlock.list content:

libvirt*-0:7.6.0-*.*
qemu*-0:6.1.0-*.*

This commit swaps Yum::RpmName with Yum::RpmNameGlob for the
versionlock assert_type() and thus allowing the above mentioned
examples.

[1] https://man7.org/linux/man-pages/man1/yum-versionlock.1.html

@foxxx0 foxxx0 added bug Something isn't working needs-tests labels Nov 4, 2021
@foxxx0 foxxx0 self-assigned this Nov 4, 2021
As stated in the manpage [1] yum versionlock supports package-wildcard
and does not require exact matches for package-names.
The following is valid `versionlock.list` content:
```
libvirt*-0:7.6.0-*.*
qemu*-0:6.1.0-*.*
```

This commit swaps `Yum::RpmName` with `Yum::RpmNameGlob` for the
versionlock `assert_type()` and thus allowing the above mentioned
examples.

[1] https://man7.org/linux/man-pages/man1/yum-versionlock.1.html
@foxxx0 foxxx0 force-pushed the allow_versionlock_glob branch from c151ebb to de4dfd3 Compare April 11, 2022 08:56
@vchepkov
Copy link

versionlock config file is very purely documented, and years of use was just accidental. https://bugzilla.redhat.com/show_bug.cgi?id=1757895#c9

command line supports wildcards, config file never did. only exact match was allowed, so anything else was rejected as a side effect

@kBite
Copy link

kBite commented Sep 16, 2022

@vchepkov Verified it's working for RHEL-8

# dnf versionlock clear
Last metadata expiration check: 0:00:12 ago on Fri 16 Sep 2022 06:20:53 PM UTC.

# dnf update --assumeno kernel
Last metadata expiration check: 0:00:16 ago on Fri 16 Sep 2022 06:20:53 PM UTC.
Dependencies resolved.
============================================================================================================================================================================================================================================================================================
 Package                                                             Architecture                                                Version                                                                       Repository                                                              Size
============================================================================================================================================================================================================================================================================================
Installing:
 kernel                                                              x86_64                                                      4.18.0-372.26.1.el8_6                                                         almalinux_baseos                                                       8.1 M
 kernel-core                                                         x86_64                                                      4.18.0-372.26.1.el8_6                                                         almalinux_baseos                                                        39 M
 kernel-modules                                                      x86_64                                                      4.18.0-372.26.1.el8_6                                                         almalinux_baseos                                                        32 M
Removing:
 kernel                                                              x86_64                                                      4.18.0-372.16.1.el8_6                                                         @almalinux_baseos                                                        0
 kernel-core                                                         x86_64                                                      4.18.0-372.16.1.el8_6                                                         @almalinux_baseos                                                       69 M
 kernel-modules                                                      x86_64                                                      4.18.0-372.16.1.el8_6                                                         @almalinux_baseos                                                       23 M

Transaction Summary
============================================================================================================================================================================================================================================================================================
Install  3 Packages
Remove   3 Packages

Total download size: 79 M
Operation aborted.

# echo 'kernel*-0:4.18.0-372.16.*' > /etc/dnf/plugins/versionlock.list

# dnf update --assumeno kernel
Last metadata expiration check: 0:00:29 ago on Fri 16 Sep 2022 06:20:53 PM UTC.
Dependencies resolved.
Nothing to do.
Complete!

# cat /etc/dnf/plugins/versionlock.list
kernel*-0:4.18.0-372.16.*

Using dnf versionlock CLI it will expand the regex:

# dnf versionlock clear
...

# dnf versionlock add kernel*-0:4.18.0-372.16.*
...
Adding versionlock on: kernel-core-0:4.18.0-372.16.1.el8_6.*
Adding versionlock on: kernel-0:4.18.0-372.16.1.el8_6.*
Adding versionlock on: kernel-modules-0:4.18.0-372.16.1.el8_6.*

But when trying the same after writing the regex directly to versionlock.list it recognizes it as equivalent:

# echo 'kernel*-0:4.18.0-372.16.*' > /etc/dnf/plugins/versionlock.list

# dnf versionlock add kernel*-0:4.18.0-372.16.*
...
Package already locked in equivalent form: kernel*-0:4.18.0-372.16.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants