kernel-install.eclass: Print elog about symlink update
authorMichał Górny <mgorny@gentoo.org>
Wed, 29 Apr 2020 06:48:52 +0000 (08:48 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 29 Apr 2020 06:50:19 +0000 (08:50 +0200)
Bug: https://bugs.gentoo.org/719910
Signed-off-by: Michał Górny <mgorny@gentoo.org>
eclass/kernel-install.eclass

index 1fdeb1bf4dc7b1b1fd8661c5e5dd54e451abc5a9..c26af5c2e88bad32d591690819225f909c5aa5c8 100644 (file)
@@ -139,6 +139,7 @@ kernel-install_update_symlink() {
        else
                local symlink_target=$(readlink "${target}")
                local symlink_ver=${symlink_target#${target##*/}-}
+               local updated=
                if [[ ${symlink_target} == ${target##*/}-* && \
                                -z ${symlink_ver//[0-9.]/} ]]
                then
@@ -151,8 +152,14 @@ kernel-install_update_symlink() {
                                ebegin "Updating ${target} symlink"
                                ln -f -n -s "${target##*/}-${version}" "${target}"
                                eend ${?}
+                               updated=1
                        fi
                fi
+
+               if [[ ! ${updated} ]]; then
+                       elog "${target} points at another kernel, leaving it as-is."
+                       elog "Please use 'eselect kernel' to update it when desired."
+               fi
        fi
 }