From 2fa473a4300a20c9ca881eac6cfec9828d823e9c Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 2 Jan 2020 14:15:04 +0100 Subject: sys-kernel/vanilla-kernel: Create linux symlink when none exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- .../vanilla-kernel/vanilla-kernel-5.4.7.ebuild | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'sys-kernel') diff --git a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild index e4705ad05588..37e03a83622e 100644 --- a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild +++ b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild @@ -255,19 +255,25 @@ pkg_postinst() { eend ${?} || die "Installing the kernel failed" fi - local symlink_target=$(readlink "${EROOT}"/usr/src/linux) - local symlink_ver=${symlink_target#linux-} - if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]] - then - 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}" + if [[ ! -e ${EROOT}/usr/src/linux ]]; then + ebegin "Creating /usr/src/linux symlink" + ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux + eend ${?} + else + local symlink_target=$(readlink "${EROOT}"/usr/src/linux) + local symlink_ver=${symlink_target#linux-} + if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]] then - ebegin "Updating /usr/src/linux symlink" - ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux - eend ${?} + 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 fi -- cgit v1.2.3-65-gdbad