Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/vanilla-kernel-bin/
Date: Thu, 02 Jan 2020 13:19:53
Message-Id: 1577971182.b26cada012ec1134770f90e79990d10ccb2744cc.mgorny@gentoo
1 commit: b26cada012ec1134770f90e79990d10ccb2744cc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 2 13:14:29 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 2 13:19:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b26cada0
7
8 sys-kernel/vanilla-kernel-bin: Create linux symlink when none
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../vanilla-kernel-bin-5.4.7.ebuild | 30 +++++++++++++---------
13 1 file changed, 18 insertions(+), 12 deletions(-)
14
15 diff --git a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild
16 index c7f50b935aa..998f07ed5e9 100644
17 --- a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild
18 +++ b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild
19 @@ -147,19 +147,25 @@ pkg_postinst() {
20 eend ${?} || die "Installing the kernel failed"
21 fi
22
23 - local symlink_target=$(readlink "${EROOT}"/usr/src/linux)
24 - local symlink_ver=${symlink_target#linux-}
25 - if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]]
26 - then
27 - local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver}
28 - # if the current target is either being replaced, or still
29 - # installed (probably depclean candidate), update the symlink
30 - if has "${symlink_ver}" ${REPLACING_VERSIONS} ||
31 - has_version -r "~${symlink_pkg}"
32 + if [[ ! -e ${EROOT}/usr/src/linux ]]; then
33 + ebegin "Creating /usr/src/linux symlink"
34 + ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux
35 + eend ${?}
36 + else
37 + local symlink_target=$(readlink "${EROOT}"/usr/src/linux)
38 + local symlink_ver=${symlink_target#linux-}
39 + if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]]
40 then
41 - ebegin "Updating /usr/src/linux symlink"
42 - ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux
43 - eend ${?}
44 + local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver}
45 + # if the current target is either being replaced, or still
46 + # installed (probably depclean candidate), update the symlink
47 + if has "${symlink_ver}" ${REPLACING_VERSIONS} ||
48 + has_version -r "~${symlink_pkg}"
49 + then
50 + ebegin "Updating /usr/src/linux symlink"
51 + ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux
52 + eend ${?}
53 + fi
54 fi
55 fi
56 }