1 |
commit: 2fa473a4300a20c9ca881eac6cfec9828d823e9c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 2 13:15:04 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 2 13:19:43 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fa473a4 |
7 |
|
8 |
sys-kernel/vanilla-kernel: Create linux symlink when none exists |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../vanilla-kernel/vanilla-kernel-5.4.7.ebuild | 30 +++++++++++++--------- |
13 |
1 file changed, 18 insertions(+), 12 deletions(-) |
14 |
|
15 |
diff --git a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild |
16 |
index e4705ad0558..37e03a83622 100644 |
17 |
--- a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild |
18 |
+++ b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.7.ebuild |
19 |
@@ -255,19 +255,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 |