summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-12-19 11:14:25 +0100
committerMichał Górny <mgorny@gentoo.org>2019-12-19 20:27:37 +0100
commit2e8bd51fc836d1aee4722b40caab2faa3a4626a5 (patch)
treec0b33d9483425d375e61de5d2925aeb0ac6be96c /sys-kernel
parentdev-libs/icu-layoutex: stable 65.1 for sparc, bug #702500 (diff)
downloadgentoo-2e8bd51fc836d1aee4722b40caab2faa3a4626a5.tar.gz
gentoo-2e8bd51fc836d1aee4722b40caab2faa3a4626a5.tar.bz2
gentoo-2e8bd51fc836d1aee4722b40caab2faa3a4626a5.zip
sys-kernel/vanilla-kernel: Update symlink target after installing
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/vanilla-kernel/vanilla-kernel-5.4.5.ebuild15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.5.ebuild b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.5.ebuild
index dc2837b8fd05..37b591ff1c59 100644
--- a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.5.ebuild
+++ b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.5.ebuild
@@ -151,8 +151,21 @@ pkg_postinst() {
eend || fail=1
[[ ${fail} ]] && die "Installing the kernel failed"
+ fi
- # TODO: update /usr/src/linux symlink?
+ local symlink_target=$(readlink "${EROOT}"/usr/src/linux)
+ if [[ ${symlink_target} == linux-[0-9]* ]]; then
+ local symlink_ver=${symlink_target#linux-}
+ local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver}
+ # if the current target is either being replaced, or still
+ # installed (probably depclean candidate), update the symlink
+ if has "${symlink_ver}" ${REPLACING_VERSIONS} ||
+ has_version -r "~${symlink_pkg}"
+ then
+ ebegin "Updating /usr/src/linux symlink"
+ ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux
+ eend
+ fi
fi
savedconfig_pkg_postinst