diff options
| author | Michał Górny <mgorny@gentoo.org> | 2025-10-03 14:38:19 +0200 |
|---|---|---|
| committer | Michał Górny <mgorny@gentoo.org> | 2025-10-03 21:11:24 +0200 |
| commit | 74b839fa53c6ebb386df6ec85e185020978d0b6c (patch) | |
| tree | ed462ef3cfd638734939ca40b8d1b601d5de4a5a /eclass/kernel-install.eclass | |
| parent | fae0f8549bcb05322c98608e50245f4a27239846 (diff) | |
| download | gentoo-74b839fa53c6ebb386df6ec85e185020978d0b6c.tar.gz gentoo-74b839fa53c6ebb386df6ec85e185020978d0b6c.tar.bz2 gentoo-74b839fa53c6ebb386df6ec85e185020978d0b6c.zip | |
kernel-install.eclass: Fix updating symlinks with -p kernels
Closes: https://bugs.gentoo.org/963683
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/44021
Closes: https://github.com/gentoo/gentoo/pull/44021
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
| -rw-r--r-- | eclass/kernel-install.eclass | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index 47afe6e75010..5d074598192f 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -263,10 +263,15 @@ kernel-install_can_update_symlink() { # strip KV_LOCALVERSION, we want to update the old kernels not using # KV_LOCALVERSION suffix and the new kernels using it symlink_ver=${symlink_ver%${KV_LOCALVERSION}} - - # if ${symlink_ver} contains anything but numbers (e.g. an extra - # suffix), it's not our kernel, so leave it alone - [[ -n ${symlink_ver//[0-9.]/} ]] && return 1 + symlink_ver=${symlink_ver/-p/_p} + # strip -p* revision + local symlink_ver_no_rev=${symlink_ver%_p[0-9]*} + local rev=${symlink_ver#${symlink_ver_no_rev}} + rev=${rev#_p} + + # if ${symlink_ver} contained anything but numbers and revision (e.g. + # an extra suffix), it's not our kernel, so leave it alone + [[ -n ${symlink_ver_no_rev//[0-9.]/} || -n ${rev//[0-9]/} ]] && return 1 local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver} # if the current target is either being replaced, or still |
